| 67 | } |
| 68 | |
| 69 | int EXTThread::create(void *(*start_routine)(void *), void *arg) |
| 70 | { |
| 71 | int result = 22; //EINVAL; |
| 72 | |
| 73 | if (! initialised) |
| 74 | { |
| 75 | #ifdef EXT_BOOST |
| 76 | bthread = boost::thread(start_routine, arg); |
| 77 | result = 0; |
| 78 | #else |
| 79 | result = pthread_create(&pthread, NULL, start_routine, arg); |
| 80 | #endif |
| 81 | initialised = ! result; |
| 82 | } |
| 83 | |
| 84 | #ifdef _EXTTHREAD_DEBUG_ |
| 85 | if (result) |
| 86 | { |
| 87 | std::cerr << "Error creating thread: " << result << std::endl; |
| 88 | } |
| 89 | #endif |
| 90 | |
| 91 | return result; |
| 92 | } |
| 93 | |
| 94 | |
| 95 | int EXTThread::detach() |
no outgoing calls
no test coverage detected