| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 University of Szeged | 2 * Copyright (C) 2011 University of Szeged |
| 3 * Copyright (C) 2011 Gabor Loki <loki@webkit.org> | 3 * Copyright (C) 2011 Gabor Loki <loki@webkit.org> |
| 4 * All rights reserved. | 4 * All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #ifndef ParallelJobsLibdispatch_h | 28 #ifndef ParallelJobsLibdispatch_h |
| 29 #define ParallelJobsLibdispatch_h | 29 #define ParallelJobsLibdispatch_h |
| 30 | 30 |
| 31 #if ENABLE(THREADING_LIBDISPATCH) | 31 #if ENABLE(THREADING_LIBDISPATCH) |
| 32 | 32 |
| 33 #include <dispatch/dispatch.h> | 33 #include <dispatch/dispatch.h> |
| 34 #include "wtf/WTFExport.h" |
| 34 | 35 |
| 35 namespace WTF { | 36 namespace WTF { |
| 36 | 37 |
| 37 class ParallelEnvironment { | 38 class WTF_EXPORT ParallelEnvironment { |
| 38 WTF_MAKE_FAST_ALLOCATED; | 39 WTF_MAKE_FAST_ALLOCATED; |
| 39 public: | 40 public: |
| 40 typedef void (*ThreadFunction)(void*); | 41 typedef void (*ThreadFunction)(void*); |
| 41 | 42 |
| 42 ParallelEnvironment(ThreadFunction threadFunction, size_t sizeOfParameter, i
nt requestedJobNumber) | 43 ParallelEnvironment(ThreadFunction threadFunction, size_t sizeOfParameter, i
nt requestedJobNumber) |
| 43 : m_threadFunction(threadFunction) | 44 : m_threadFunction(threadFunction) |
| 44 , m_sizeOfParameter(sizeOfParameter) | 45 , m_sizeOfParameter(sizeOfParameter) |
| 45 , m_numberOfJobs(requestedJobNumber) | 46 , m_numberOfJobs(requestedJobNumber) |
| 46 { | 47 { |
| 47 // We go with the requested number of jobs. libdispatch will distribute
the work optimally. | 48 // We go with the requested number of jobs. libdispatch will distribute
the work optimally. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 64 ThreadFunction m_threadFunction; | 65 ThreadFunction m_threadFunction; |
| 65 size_t m_sizeOfParameter; | 66 size_t m_sizeOfParameter; |
| 66 int m_numberOfJobs; | 67 int m_numberOfJobs; |
| 67 }; | 68 }; |
| 68 | 69 |
| 69 } // namespace WTF | 70 } // namespace WTF |
| 70 | 71 |
| 71 #endif // ENABLE(THREADING_LIBDISPATCH) | 72 #endif // ENABLE(THREADING_LIBDISPATCH) |
| 72 | 73 |
| 73 #endif // ParallelJobsLibdispatch_h | 74 #endif // ParallelJobsLibdispatch_h |
| OLD | NEW |