< prev index next > src/hotspot/share/gc/z/zLock.hpp
/*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
pthread_mutex_t _lock;
public:
ZLock();
- void lock();
- bool try_lock();
- void unlock();
+ virtual void lock();
+ virtual bool try_lock();
+ virtual void unlock();
};
class ZLocker : public StackObj {
private:
ZLock* const _lock;
public:
ZLocker(ZLock* lock);
~ZLocker();
};
+class ZReentrantLock: public ZLock {
+ Thread* volatile _owner;
+
+public:
+ ZReentrantLock();
+
+ virtual void lock();
+ virtual bool try_lock();
+ virtual void unlock();
+
+ bool is_owned() const;
+ bool reentrant_lock();
+};
+
#endif // SHARE_GC_Z_ZLOCK_HPP
< prev index next >