| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 bool WaitFor(const TimeDelta& rel_time) V8_WARN_UNUSED_RESULT; | 73 bool WaitFor(const TimeDelta& rel_time) V8_WARN_UNUSED_RESULT; |
| 74 | 74 |
| 75 #if V8_OS_MACOSX | 75 #if V8_OS_MACOSX |
| 76 typedef semaphore_t NativeHandle; | 76 typedef semaphore_t NativeHandle; |
| 77 #elif V8_OS_POSIX | 77 #elif V8_OS_POSIX |
| 78 typedef sem_t NativeHandle; | 78 typedef sem_t NativeHandle; |
| 79 #elif V8_OS_WIN | 79 #elif V8_OS_WIN |
| 80 typedef HANDLE NativeHandle; | 80 typedef HANDLE NativeHandle; |
| 81 #endif | 81 #endif |
| 82 | 82 |
| 83 NativeHandle& native_handle() V8_WARN_UNUSED_RESULT { | 83 NativeHandle& native_handle() { |
| 84 return native_handle_; | 84 return native_handle_; |
| 85 } | 85 } |
| 86 const NativeHandle& native_handle() const V8_WARN_UNUSED_RESULT { | 86 const NativeHandle& native_handle() const { |
| 87 return native_handle_; | 87 return native_handle_; |
| 88 } | 88 } |
| 89 | 89 |
| 90 private: | 90 private: |
| 91 NativeHandle native_handle_; | 91 NativeHandle native_handle_; |
| 92 | 92 |
| 93 DISALLOW_COPY_AND_ASSIGN(Semaphore); | 93 DISALLOW_COPY_AND_ASSIGN(Semaphore); |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 | 96 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 117 Semaphore, | 117 Semaphore, |
| 118 CreateSemaphoreTrait<N>, | 118 CreateSemaphoreTrait<N>, |
| 119 ThreadSafeInitOnceTrait>::type type; | 119 ThreadSafeInitOnceTrait>::type type; |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 #define LAZY_SEMAPHORE_INITIALIZER LAZY_DYNAMIC_INSTANCE_INITIALIZER | 122 #define LAZY_SEMAPHORE_INITIALIZER LAZY_DYNAMIC_INSTANCE_INITIALIZER |
| 123 | 123 |
| 124 } } // namespace v8::internal | 124 } } // namespace v8::internal |
| 125 | 125 |
| 126 #endif // V8_PLATFORM_SEMAPHORE_H_ | 126 #endif // V8_PLATFORM_SEMAPHORE_H_ |
| OLD | NEW |