version 1.18, 2008/12/02 09:00:53
|
version 1.19, 2009/09/03 10:23:00
|
|
|
// Initialize thread attributes: | // Initialize thread attributes: |
| |
pthread_attr_t attr; | pthread_attr_t attr; |
pthread_attr_init(&attr); |
int rc = pthread_attr_init(&attr); |
|
if(rc != 0) |
|
{ |
|
return rc; |
|
} |
| |
// Detached: | // Detached: |
| |
|
|
| |
// Create thread: | // Create thread: |
| |
int rc = pthread_create(&thread.thread, &attr, start, arg); |
rc = pthread_create(&thread.thread, &attr, start, arg); |
| |
if (rc != 0) | if (rc != 0) |
{ | { |
thread = ThreadType(); | thread = ThreadType(); |
return rc; |
|
} | } |
| |
// Destroy attributes now. | // Destroy attributes now. |
|
|
| |
// Return: | // Return: |
| |
return 0; |
return rc; |
} | } |
| |
ThreadType Threads::self() | ThreadType Threads::self() |