Mercurial > hg > graal-compiler
comparison src/os/linux/vm/os_linux.hpp @ 10405:f2110083203d
8005849: JEP 167: Event-Based JVM Tracing
Reviewed-by: acorn, coleenp, sla
Contributed-by: Karen Kinnear <karen.kinnear@oracle.com>, Bengt Rutisson <bengt.rutisson@oracle.com>, Calvin Cheung <calvin.cheung@oracle.com>, Erik Gahlin <erik.gahlin@oracle.com>, Erik Helin <erik.helin@oracle.com>, Jesper Wilhelmsson <jesper.wilhelmsson@oracle.com>, Keith McGuigan <keith.mcguigan@oracle.com>, Mattias Tobiasson <mattias.tobiasson@oracle.com>, Markus Gronlund <markus.gronlund@oracle.com>, Mikael Auno <mikael.auno@oracle.com>, Nils Eliasson <nils.eliasson@oracle.com>, Nils Loodin <nils.loodin@oracle.com>, Rickard Backman <rickard.backman@oracle.com>, Staffan Larsen <staffan.larsen@oracle.com>, Stefan Karlsson <stefan.karlsson@oracle.com>, Yekaterina Kantserova <yekaterina.kantserova@oracle.com>
author | sla |
---|---|
date | Mon, 10 Jun 2013 11:30:51 +0200 |
parents | b4081e9714ec |
children | a837fa3d3f86 |
comparison
equal
deleted
inserted
replaced
10404:d0add7016434 | 10405:f2110083203d |
---|---|
207 | 207 |
208 // none present | 208 // none present |
209 | 209 |
210 // LinuxThreads work-around for 6292965 | 210 // LinuxThreads work-around for 6292965 |
211 static int safe_cond_timedwait(pthread_cond_t *_cond, pthread_mutex_t *_mutex, const struct timespec *_abstime); | 211 static int safe_cond_timedwait(pthread_cond_t *_cond, pthread_mutex_t *_mutex, const struct timespec *_abstime); |
212 | |
213 | |
214 // Linux suspend/resume support - this helper is a shadow of its former | |
215 // self now that low-level suspension is barely used, and old workarounds | |
216 // for LinuxThreads are no longer needed. | |
217 class SuspendResume { | |
218 private: | |
219 volatile int _suspend_action; | |
220 volatile jint _state; | |
221 public: | |
222 // values for suspend_action: | |
223 enum { | |
224 SR_NONE = 0x00, | |
225 SR_SUSPEND = 0x01, // suspend request | |
226 SR_CONTINUE = 0x02, // resume request | |
227 SR_SUSPENDED = 0x20 // values for _state: + SR_NONE | |
228 }; | |
229 | |
230 SuspendResume() { _suspend_action = SR_NONE; _state = SR_NONE; } | |
231 | |
232 int suspend_action() const { return _suspend_action; } | |
233 void set_suspend_action(int x) { _suspend_action = x; } | |
234 | |
235 // atomic updates for _state | |
236 inline void set_suspended(); | |
237 inline void clear_suspended(); | |
238 bool is_suspended() { return _state & SR_SUSPENDED; } | |
239 | |
240 }; | |
241 | 212 |
242 private: | 213 private: |
243 typedef int (*sched_getcpu_func_t)(void); | 214 typedef int (*sched_getcpu_func_t)(void); |
244 typedef int (*numa_node_to_cpus_func_t)(int node, unsigned long *buffer, int bufferlen); | 215 typedef int (*numa_node_to_cpus_func_t)(int node, unsigned long *buffer, int bufferlen); |
245 typedef int (*numa_max_node_func_t)(void); | 216 typedef int (*numa_max_node_func_t)(void); |
331 status = pthread_cond_init (_cond, NULL); | 302 status = pthread_cond_init (_cond, NULL); |
332 assert_status(status == 0, status, "cond_init"); | 303 assert_status(status == 0, status, "cond_init"); |
333 status = pthread_mutex_init (_mutex, NULL); | 304 status = pthread_mutex_init (_mutex, NULL); |
334 assert_status(status == 0, status, "mutex_init"); | 305 assert_status(status == 0, status, "mutex_init"); |
335 } | 306 } |
336 } ; | 307 }; |
337 | 308 |
338 #endif // OS_LINUX_VM_OS_LINUX_HPP | 309 #endif // OS_LINUX_VM_OS_LINUX_HPP |