Last change
on this file since 1144 was
1144,
checked in by sam, 11 years ago
|
threads: change Queue to a template so that we can manage the element type.
|
-
Property svn:keywords set to
Id
|
File size:
964 bytes
|
Rev | Line | |
---|
[1093] | 1 | // |
---|
| 2 | // Lol Engine |
---|
| 3 | // |
---|
| 4 | // Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net> |
---|
| 5 | // This program is free software; you can redistribute it and/or |
---|
| 6 | // modify it under the terms of the Do What The Fuck You Want To |
---|
| 7 | // Public License, Version 2, as published by Sam Hocevar. See |
---|
| 8 | // http://sam.zoy.org/projects/COPYING.WTFPL for more details. |
---|
| 9 | // |
---|
| 10 | |
---|
| 11 | // |
---|
| 12 | // The Threading classes |
---|
| 13 | // --------------------- |
---|
| 14 | // |
---|
| 15 | |
---|
| 16 | #if !defined __LOL_THREAD_H__ |
---|
| 17 | #define __LOL_THREAD_H__ |
---|
| 18 | |
---|
| 19 | #if defined __CELLOS_LV2__ |
---|
| 20 | # include "platform/ps3/threadbase.h" |
---|
| 21 | #else |
---|
| 22 | # include "threadbase.h" |
---|
| 23 | #endif |
---|
| 24 | |
---|
| 25 | namespace lol |
---|
| 26 | { |
---|
| 27 | |
---|
| 28 | class Mutex : public MutexBase |
---|
| 29 | { |
---|
| 30 | public: |
---|
| 31 | Mutex() : MutexBase() {} |
---|
| 32 | }; |
---|
| 33 | |
---|
[1144] | 34 | template<typename T, int N = 128> class Queue : public QueueBase<T, N> |
---|
[1093] | 35 | { |
---|
| 36 | public: |
---|
[1144] | 37 | Queue() : QueueBase<T, N>() {} |
---|
[1093] | 38 | }; |
---|
| 39 | |
---|
| 40 | class Thread : ThreadBase |
---|
| 41 | { |
---|
| 42 | public: |
---|
| 43 | Thread(void *(*fn)(void *), void *data) : ThreadBase(fn, data) {} |
---|
| 44 | virtual ~Thread() {} |
---|
| 45 | }; |
---|
| 46 | |
---|
| 47 | } /* namespace lol */ |
---|
| 48 | |
---|
| 49 | #endif // __LOL_THREAD_H__ |
---|
| 50 | |
---|
Note: See
TracBrowser
for help on using the repository browser.