diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-10-06 03:25:22 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-10-06 03:25:22 +0000 |
commit | 208b983734d7431699f4bd3534e08321e42ada86 (patch) | |
tree | a6865f0db36e9c3b8dd13b9ed4d10d282f0f7cbf /src/thread.cpp | |
parent | 1358cb4c7325e01c13533ca402cccc28575cdf14 (diff) | |
download | libbu++-208b983734d7431699f4bd3534e08321e42ada86.tar.gz libbu++-208b983734d7431699f4bd3534e08321e42ada86.tar.bz2 libbu++-208b983734d7431699f4bd3534e08321e42ada86.tar.xz libbu++-208b983734d7431699f4bd3534e08321e42ada86.zip |
Renamed most of the core threading system, some ancillary systems need some
kind of prefix or something, we could stick with Ito, I will until I think of
something else.
Diffstat (limited to '')
-rw-r--r-- | src/thread.cpp (renamed from src/ito.cpp) | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/ito.cpp b/src/thread.cpp index aa9a597..e4563a2 100644 --- a/src/ito.cpp +++ b/src/thread.cpp | |||
@@ -5,51 +5,51 @@ | |||
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include "bu/ito.h" | 8 | #include "bu/thread.h" |
9 | 9 | ||
10 | #include "bu/config.h" | 10 | #include "bu/config.h" |
11 | 11 | ||
12 | Bu::Ito::Ito() | 12 | Bu::Thread::Thread() |
13 | { | 13 | { |
14 | } | 14 | } |
15 | 15 | ||
16 | Bu::Ito::~Ito() | 16 | Bu::Thread::~Thread() |
17 | { | 17 | { |
18 | } | 18 | } |
19 | 19 | ||
20 | bool Bu::Ito::start() | 20 | bool Bu::Thread::start() |
21 | { | 21 | { |
22 | nHandle = pthread_create( &ptHandle, NULL, threadRunner, this ); | 22 | nHandle = pthread_create( &ptHandle, NULL, threadRunner, this ); |
23 | 23 | ||
24 | return true; | 24 | return true; |
25 | } | 25 | } |
26 | 26 | ||
27 | bool Bu::Ito::stop() | 27 | bool Bu::Thread::stop() |
28 | { | 28 | { |
29 | pthread_cancel( ptHandle ); | 29 | pthread_cancel( ptHandle ); |
30 | 30 | ||
31 | return true; | 31 | return true; |
32 | } | 32 | } |
33 | 33 | ||
34 | void *Bu::Ito::threadRunner( void *pThread ) | 34 | void *Bu::Thread::threadRunner( void *pThread ) |
35 | { | 35 | { |
36 | ((Ito *)pThread)->run(); | 36 | ((Thread *)pThread)->run(); |
37 | pthread_exit( NULL ); | 37 | pthread_exit( NULL ); |
38 | return NULL; | 38 | return NULL; |
39 | } | 39 | } |
40 | 40 | ||
41 | bool Bu::Ito::join() | 41 | bool Bu::Thread::join() |
42 | { | 42 | { |
43 | pthread_join( ptHandle, NULL ); | 43 | pthread_join( ptHandle, NULL ); |
44 | return true; | 44 | return true; |
45 | } | 45 | } |
46 | 46 | ||
47 | void Bu::Ito::yield() | 47 | void Bu::Thread::yield() |
48 | { | 48 | { |
49 | #ifndef WIN32 | 49 | #ifndef WIN32 |
50 | pthread_yield(); | 50 | pthread_yield(); |
51 | #else | 51 | #else |
52 | #warning Bu::Ito::yield IS A STUB for WIN32!!!! | 52 | #warning Bu::Thread::yield IS A STUB for WIN32!!!! |
53 | #endif | 53 | #endif |
54 | } | 54 | } |
55 | 55 | ||