23 #if ! defined (octave_oct_mutex_h) 24 #define octave_oct_mutex_h 1 26 #include "octave-config.h" 44 virtual void lock (
void);
46 virtual void unlock (
void);
48 virtual bool try_lock (
void);
69 if (--rep->count == 0)
77 if (--rep->count == 0)
99 return rep->try_lock ();
111 : m_mutex (m), m_lock_result (
false)
116 m_lock_result =
true;
119 m_lock_result = m_mutex.try_lock ();
134 bool ok (
void)
const {
return m_lock_result; }
136 operator bool (
void)
const {
return ok (); }
152 static void init (
void);
154 static bool is_thread (
void);
156 OCTAVE_DEPRECATED (4.4,
"use 'is_thread' instead")
157 static
bool is_octave_thread (
void) {
return is_thread (); }
161 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS) 163 OCTAVE_DEPRECATED (4.4,
"use 'octave::mutex' instead")
164 typedef
octave::mutex octave_mutex;
167 typedef
octave::base_mutex octave_base_mutex;
170 typedef
octave::autolock octave_autolock;
173 typedef
octave::thread octave_thread;
autolock(const mutex &m, bool block=true)