Changeset 23530 for trunk/Ohana/src/opihi/pantasks/thread_locks.c
- Timestamp:
- Mar 25, 2009, 11:56:09 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pantasks/thread_locks.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pantasks/thread_locks.c
r11084 r23530 1 1 # include "pantasks.h" 2 2 3 /* this mutex is used by the serialized threads */ 3 /* mutex to lock Client table operations */ 4 static pthread_mutex_t ClientMutex = PTHREAD_MUTEX_INITIALIZER; 4 5 5 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; 6 7 void SerialThreadLock () { 8 pthread_mutex_lock (&mutex); 6 void ClientLock () { 7 pthread_mutex_lock (&ClientMutex); 9 8 } 10 9 11 void SerialThreadUnlock () {12 pthread_mutex_unlock (&mutex);10 void ClientUnlock () { 11 pthread_mutex_unlock (&ClientMutex); 13 12 } 14 13 14 /* mutex to lock Command / Multicommand operations */ 15 static pthread_mutex_t CommandMutex = PTHREAD_MUTEX_INITIALIZER; 16 17 void CommandLock () { 18 // fprintf (stderr, "command lock\n"); 19 pthread_mutex_lock (&CommandMutex); 20 } 21 22 void CommandUnlock () { 23 // fprintf (stderr, "command unlock\n"); 24 pthread_mutex_unlock (&CommandMutex); 25 } 26 27 /* mutex to lock Control operations */ 28 static pthread_mutex_t ControlMutex = PTHREAD_MUTEX_INITIALIZER; 29 30 void ControlLock (char *func) { 31 // fprintf (stderr, "control lock %s\n", func); 32 pthread_mutex_lock (&ControlMutex); 33 } 34 35 void ControlUnlock (char *func) { 36 // fprintf (stderr, "control unlock %s\n", func); 37 pthread_mutex_unlock (&ControlMutex); 38 } 39 40 /* mutex to lock Job / Task operations */ 41 static pthread_mutex_t JobTaskMutex = PTHREAD_MUTEX_INITIALIZER; 42 43 void JobTaskLock () { 44 // fprintf (stderr, "jobtask lock\n"); 45 pthread_mutex_lock (&JobTaskMutex); 46 } 47 48 void JobTaskUnlock () { 49 // fprintf (stderr, "jobtask unlock\n"); 50 pthread_mutex_unlock (&JobTaskMutex); 51 } 52
Note:
See TracChangeset
for help on using the changeset viewer.
