2004 by Marc J. Rochkind. All rights reserved. Portions marked "Open Source" may be copied under license.

 

Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

c5/tx5.c File Reference


Detailed Description

Thread example (condition variable) [Sec. 5.17.4].

Definition in file tx5.c.

Go to the source code of this file.

Compounds

struct  node

Functions

void * thread_func (void *arg)
int main (void)

Variables

pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER
pthread_cond_t cond = PTHREAD_COND_INITIALIZER
node * head


Function Documentation

int main void   ) 
 

Definition at line 56 of file tx5.c.

References cond, EC_CLEANUP_BGN, EC_CLEANUP_END, ec_null, ec_rv, head, mtx, node::n_next, node::n_number, pthread_cond_signal(), pthread_create(), pthread_join(), pthread_mutex_lock(), pthread_mutex_unlock(), sleep(), and thread_func().

void* thread_func void *  arg  )  [static]
 

Definition at line 33 of file tx5.c.

References cond, EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FLUSH, ec_rv, head, mtx, node::n_next, node::n_number, pthread_cond_wait(), pthread_mutex_lock(), and pthread_mutex_unlock().

Referenced by main().


Variable Documentation

pthread_cond_t cond = PTHREAD_COND_INITIALIZER [static]
 

Definition at line 26 of file tx5.c.

Referenced by main(), and thread_func().

struct node * head
 

Referenced by free_pathlist(), get_pathlist(), getcwdx(), main(), push_pathlist(), and thread_func().

pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER [static]
 

Definition at line 25 of file tx5.c.

Referenced by main(), and thread_func().


Generated on Fri Apr 23 10:57:08 2004 for AUP2 Example Source by doxygen 1.3.1