Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
d8fe99d9
Commit
d8fe99d9
authored
Apr 05, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comment that sched_yield might be a portability problem.
parent
a86c329f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/tools/thread/thread_test.c
src/tools/thread/thread_test.c
+4
-4
No files found.
src/tools/thread/thread_test.c
View file @
d8fe99d9
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.1
4 2004/04/05 14:12:32
momjian Exp $
* $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.1
5 2004/04/05 14:13:45
momjian Exp $
*
*
* This program tests to see if your standard libc functions use
* This program tests to see if your standard libc functions use
* pthread_setspecific()/pthread_getspecific() to be thread-safe.
* pthread_setspecific()/pthread_getspecific() to be thread-safe.
...
@@ -83,7 +83,7 @@ defines to your template/$port file before compiling this program.\n\n"
...
@@ -83,7 +83,7 @@ defines to your template/$port file before compiling this program.\n\n"
pthread_create
(
&
thread2
,
NULL
,
(
void
*
(
*
)(
void
*
))
func_call_2
,
NULL
);
pthread_create
(
&
thread2
,
NULL
,
(
void
*
(
*
)(
void
*
))
func_call_2
,
NULL
);
while
(
thread1_done
==
0
||
thread2_done
==
0
)
while
(
thread1_done
==
0
||
thread2_done
==
0
)
sched_yield
();
/*
force system call
*/
sched_yield
();
/*
if this is a portability problem, remove it
*/
printf
(
"Add this to your template/$port file:
\n\n
"
);
printf
(
"Add this to your template/$port file:
\n\n
"
);
...
@@ -129,7 +129,7 @@ void func_call_1(void) {
...
@@ -129,7 +129,7 @@ void func_call_1(void) {
*/
*/
errno1_set
=
1
;
errno1_set
=
1
;
while
(
errno2_set
==
0
)
while
(
errno2_set
==
0
)
sched_yield
();
/* force system call */
sched_yield
();
if
(
errno
!=
EEXIST
)
if
(
errno
!=
EEXIST
)
{
{
fprintf
(
stderr
,
"errno not thread-safe; exiting
\n
"
);
fprintf
(
stderr
,
"errno not thread-safe; exiting
\n
"
);
...
@@ -184,7 +184,7 @@ void func_call_2(void) {
...
@@ -184,7 +184,7 @@ void func_call_2(void) {
*/
*/
errno2_set
=
1
;
errno2_set
=
1
;
while
(
errno1_set
==
0
)
while
(
errno1_set
==
0
)
sched_yield
();
/* force system call */
sched_yield
();
if
(
errno
!=
ENOENT
)
if
(
errno
!=
ENOENT
)
{
{
fprintf
(
stderr
,
"errno not thread-safe; exiting
\n
"
);
fprintf
(
stderr
,
"errno not thread-safe; exiting
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment