Changeset 28405 for trunk/psLib/src/sys/psThread.c
- Timestamp:
- Jun 18, 2010, 2:25:38 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psThread.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psThread.c
r28402 r28405 99 99 bool psThreadJobAddPending(psThreadJob *job) 100 100 { 101 PS_ASSERT_THREAD_JOB_NON_NULL(job, false); 101 if (!job) { 102 // Asking for a no-op 103 return true; 104 } 102 105 103 106 psThreadTask *task = psHashLookup(tasks, job->type); // Task to execute job … … 114 117 } 115 118 psListAdd(done, PS_LIST_TAIL, job); 116 119 psFree(job); 117 120 return task->function(job); 118 121 } … … 123 126 } 124 127 psListAdd(pending, PS_LIST_TAIL, job); 128 psFree(job); 125 129 psThreadUnlock(); 126 130 … … 279 283 for (int i = 0; i < nThreads; i++) { 280 284 psThread *thread = pool->data[i] = psThreadAlloc(); // Thread for pool 281 if ( !pthread_create(&threads[i], NULL, psThreadLauncher, thread)) {285 if (pthread_create(&threads[i], NULL, psThreadLauncher, thread)) { 282 286 psAbort("Unable to create thread"); 283 287 }
Note:
See TracChangeset
for help on using the changeset viewer.
