equal
deleted
inserted
replaced
28 // Bsd_OS defines the interface to Bsd operating systems |
28 // Bsd_OS defines the interface to Bsd operating systems |
29 |
29 |
30 // Information about the protection of the page at address '0' on this os. |
30 // Information about the protection of the page at address '0' on this os. |
31 static bool zero_page_read_protected() { return true; } |
31 static bool zero_page_read_protected() { return true; } |
32 |
32 |
33 /* pthread_getattr_np comes with BsdThreads-0.9-7 on RedHat 7.1 */ |
33 // pthread_getattr_np comes with BsdThreads-0.9-7 on RedHat 7.1 |
34 typedef int (*pthread_getattr_func_type) (pthread_t, pthread_attr_t *); |
34 typedef int (*pthread_getattr_func_type)(pthread_t, pthread_attr_t *); |
35 |
35 |
36 #ifdef __APPLE__ |
36 #ifdef __APPLE__ |
37 // Mac OS X doesn't support clock_gettime. Stub out the type, it is |
37 // Mac OS X doesn't support clock_gettime. Stub out the type, it is |
38 // unused |
38 // unused |
39 typedef int clockid_t; |
39 typedef int clockid_t; |
203 ~PlatformEvent() { guarantee(0, "invariant"); } |
203 ~PlatformEvent() { guarantee(0, "invariant"); } |
204 |
204 |
205 public: |
205 public: |
206 PlatformEvent() { |
206 PlatformEvent() { |
207 int status; |
207 int status; |
208 status = pthread_cond_init (_cond, NULL); |
208 status = pthread_cond_init(_cond, NULL); |
209 assert_status(status == 0, status, "cond_init"); |
209 assert_status(status == 0, status, "cond_init"); |
210 status = pthread_mutex_init (_mutex, NULL); |
210 status = pthread_mutex_init(_mutex, NULL); |
211 assert_status(status == 0, status, "mutex_init"); |
211 assert_status(status == 0, status, "mutex_init"); |
212 _Event = 0; |
212 _Event = 0; |
213 _nParked = 0; |
213 _nParked = 0; |
214 _Assoc = NULL; |
214 _Assoc = NULL; |
215 } |
215 } |
232 ~PlatformParker() { guarantee(0, "invariant"); } |
232 ~PlatformParker() { guarantee(0, "invariant"); } |
233 |
233 |
234 public: |
234 public: |
235 PlatformParker() { |
235 PlatformParker() { |
236 int status; |
236 int status; |
237 status = pthread_cond_init (_cond, NULL); |
237 status = pthread_cond_init(_cond, NULL); |
238 assert_status(status == 0, status, "cond_init"); |
238 assert_status(status == 0, status, "cond_init"); |
239 status = pthread_mutex_init (_mutex, NULL); |
239 status = pthread_mutex_init(_mutex, NULL); |
240 assert_status(status == 0, status, "mutex_init"); |
240 assert_status(status == 0, status, "mutex_init"); |
241 } |
241 } |
242 }; |
242 }; |
243 |
243 |
244 #endif // OS_BSD_VM_OS_BSD_HPP |
244 #endif // OS_BSD_VM_OS_BSD_HPP |