Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird pthread portability issue.

Status
Not open for further replies.

macd68

Technical User
Nov 7, 2007
115
0
0
US
This code works fine on linux (2.6 kernel GCC v 3.3.3):

Code:
                                 while (1) {
                                           pthread_cond_wait(&waited_on,&notify_mutex);
                                           printf("%d: Sent or received timequery from client thread %d at %d.\n",getpid(),seen,time(NULL));
                                           seen = 0;
                                 }

The anticipated behavior is blocking till pthread_cond_signal() from another thread obviously.

Under FreeBSD 6.0 (gcc 3.4.4) this same code (event loop) results in non-blocking behavior.

Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top