equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
23 |
23 |
24 #ifndef SHARE_GC_Z_ZLOCK_HPP |
24 #ifndef SHARE_GC_Z_ZLOCK_HPP |
25 #define SHARE_GC_Z_ZLOCK_HPP |
25 #define SHARE_GC_Z_ZLOCK_HPP |
26 |
26 |
27 #include "memory/allocation.hpp" |
27 #include "memory/allocation.hpp" |
28 #include <pthread.h> |
28 #include "runtime/os.hpp" |
29 |
29 |
30 class ZLock { |
30 class ZLock { |
31 private: |
31 private: |
32 pthread_mutex_t _lock; |
32 os::PlatformMutex _lock; |
33 |
33 |
34 public: |
34 public: |
35 ZLock(); |
|
36 ~ZLock(); |
|
37 |
|
38 void lock(); |
35 void lock(); |
39 bool try_lock(); |
36 bool try_lock(); |
40 void unlock(); |
37 void unlock(); |
41 }; |
38 }; |
42 |
39 |