equal
deleted
inserted
replaced
25 #ifndef OS_LINUX_VM_OS_LINUX_HPP |
25 #ifndef OS_LINUX_VM_OS_LINUX_HPP |
26 #define OS_LINUX_VM_OS_LINUX_HPP |
26 #define OS_LINUX_VM_OS_LINUX_HPP |
27 |
27 |
28 // Linux_OS defines the interface to Linux operating systems |
28 // Linux_OS defines the interface to Linux operating systems |
29 |
29 |
30 /* pthread_getattr_np comes with LinuxThreads-0.9-7 on RedHat 7.1 */ |
30 // pthread_getattr_np comes with LinuxThreads-0.9-7 on RedHat 7.1 |
31 typedef int (*pthread_getattr_func_type) (pthread_t, pthread_attr_t *); |
31 typedef int (*pthread_getattr_func_type)(pthread_t, pthread_attr_t *); |
32 |
32 |
33 // Information about the protection of the page at address '0' on this os. |
33 // Information about the protection of the page at address '0' on this os. |
34 static bool zero_page_read_protected() { return true; } |
34 static bool zero_page_read_protected() { return true; } |
35 |
35 |
36 class Linux { |
36 class Linux { |
300 ~PlatformEvent() { guarantee(0, "invariant"); } |
300 ~PlatformEvent() { guarantee(0, "invariant"); } |
301 |
301 |
302 public: |
302 public: |
303 PlatformEvent() { |
303 PlatformEvent() { |
304 int status; |
304 int status; |
305 status = pthread_cond_init (_cond, os::Linux::condAttr()); |
305 status = pthread_cond_init(_cond, os::Linux::condAttr()); |
306 assert_status(status == 0, status, "cond_init"); |
306 assert_status(status == 0, status, "cond_init"); |
307 status = pthread_mutex_init (_mutex, NULL); |
307 status = pthread_mutex_init(_mutex, NULL); |
308 assert_status(status == 0, status, "mutex_init"); |
308 assert_status(status == 0, status, "mutex_init"); |
309 _Event = 0; |
309 _Event = 0; |
310 _nParked = 0; |
310 _nParked = 0; |
311 _Assoc = NULL; |
311 _Assoc = NULL; |
312 } |
312 } |
334 ~PlatformParker() { guarantee(0, "invariant"); } |
334 ~PlatformParker() { guarantee(0, "invariant"); } |
335 |
335 |
336 public: |
336 public: |
337 PlatformParker() { |
337 PlatformParker() { |
338 int status; |
338 int status; |
339 status = pthread_cond_init (&_cond[REL_INDEX], os::Linux::condAttr()); |
339 status = pthread_cond_init(&_cond[REL_INDEX], os::Linux::condAttr()); |
340 assert_status(status == 0, status, "cond_init rel"); |
340 assert_status(status == 0, status, "cond_init rel"); |
341 status = pthread_cond_init (&_cond[ABS_INDEX], NULL); |
341 status = pthread_cond_init(&_cond[ABS_INDEX], NULL); |
342 assert_status(status == 0, status, "cond_init abs"); |
342 assert_status(status == 0, status, "cond_init abs"); |
343 status = pthread_mutex_init (_mutex, NULL); |
343 status = pthread_mutex_init(_mutex, NULL); |
344 assert_status(status == 0, status, "mutex_init"); |
344 assert_status(status == 0, status, "mutex_init"); |
345 _cur_index = -1; // mark as unused |
345 _cur_index = -1; // mark as unused |
346 } |
346 } |
347 }; |
347 }; |
348 |
348 |