(locker): Remove unused class.
(new_muto): Delete.
(new_muto1): Ditto.
(new_muto_name): Ditto.
* cygheap.cc (cygheap_setup_for_child): Reflect use of static storage for muto
rather than pointer.
(_csbrk): Ditto.
(_cmalloc): Ditto.
(_cmalloc): Ditto.
(_cfree): Ditto.
* cygheap.h (cwdstuff::cwd_lock): Ditto.
(cwdstuff::get_drive): Ditto.
* cygmalloc.h (__malloc_lock): Ditto.
(__malloc_unlock): Ditto.
* cygtls.cc (sentry::lock): Ditto.
(sentry::sentry): Ditto.
(~sentry): Ditto.
(_cygtls::init): Ditto.
* dcrt0.cc: Ditto.
(cygwin_atexit): Ditto.
(cygwin_exit): Ditto.
* debug.cc (lock_debug::locker): Ditto.
(lock_debug::lock_debug): Ditto.
(lock_debug::unlock): Ditto.
(debug_init): Ditto.
* dtable.cc (dtable::init_lock): Ditto.
* dtable.h (dtable::lock_cs): Ditto.
(dtable::lock): Ditto.
(dtable::unlock): Ditto.
* exceptions.cc (mask_sync): Ditto.
(sighold): Ditto.
(set_process_mask_delta): Ditto.
(set_signal_mask): Ditto.
(events_init): Ditto.
* grp.cc (pwdgrp::pwdgrp): Ditto.
* malloc_wrapper.cc (mallock): Ditto.
(malloc_init): Ditto.
* path.cc (cwdstuff::cwd_lock): Ditto.
(cwdstuff::get_hash): Ditto.
(cwdstuff::get_hash): Ditto.
(cwdstuff::init): Ditto.
(cwdstuff::set): Ditto.
(cwdstuff::get): Ditto.
* pwdgrp.h (pwdgrp::pglock): Ditto.
(pwdgrp::refresh): Ditto.
* sigproc.cc (sync_proc_subproc): Ditto.
(get_proc_lock): Ditto.
(proc_subproc): Ditto.
(_cygtls::remove_wq): Ditto.
(proc_terminate): Ditto.
(sigproc_init): Ditto.
* timer.cc (lock_timer_tracker::protect): Ditto.
(lock_timer_tracker::lock_timer_tracker): Ditto.
(lock_timer_tracker::~lock_timer_tracker): Ditto.
* wininfo.cc (wininfo::_lock;): Ditto.
(wininfo::winthread): Ditto.
(operator HWND): Ditto.
(wininfo::lock): Ditto.
(wininfo::release): Ditto.
* wininfo.h (wininfo::_lock;): Ditto.
+2005-04-05 Christopher Faylor <cgf@timesys.com>
+
+ * sync.h (muto::operator int): New operator.
+ (locker): Remove unused class.
+ (new_muto): Delete.
+ (new_muto1): Ditto.
+ (new_muto_name): Ditto.
+ * cygheap.cc (cygheap_setup_for_child): Reflect use of static storage
+ for muto rather than pointer.
+ (_csbrk): Ditto.
+ (_cmalloc): Ditto.
+ (_cmalloc): Ditto.
+ (_cfree): Ditto.
+ * cygheap.h (cwdstuff::cwd_lock): Ditto.
+ (cwdstuff::get_drive): Ditto.
+ * cygmalloc.h (__malloc_lock): Ditto.
+ (__malloc_unlock): Ditto.
+ * cygtls.cc (sentry::lock): Ditto.
+ (sentry::sentry): Ditto.
+ (~sentry): Ditto.
+ (_cygtls::init): Ditto.
+ * dcrt0.cc: Ditto.
+ (cygwin_atexit): Ditto.
+ (cygwin_exit): Ditto.
+ * debug.cc (lock_debug::locker): Ditto.
+ (lock_debug::lock_debug): Ditto.
+ (lock_debug::unlock): Ditto.
+ (debug_init): Ditto.
+ * dtable.cc (dtable::init_lock): Ditto.
+ * dtable.h (dtable::lock_cs): Ditto.
+ (dtable::lock): Ditto.
+ (dtable::unlock): Ditto.
+ * exceptions.cc (mask_sync): Ditto.
+ (sighold): Ditto.
+ (set_process_mask_delta): Ditto.
+ (set_signal_mask): Ditto.
+ (events_init): Ditto.
+ * grp.cc (pwdgrp::pwdgrp): Ditto.
+ * malloc_wrapper.cc (mallock): Ditto.
+ (malloc_init): Ditto.
+ * path.cc (cwdstuff::cwd_lock): Ditto.
+ (cwdstuff::get_hash): Ditto.
+ (cwdstuff::get_hash): Ditto.
+ (cwdstuff::init): Ditto.
+ (cwdstuff::set): Ditto.
+ (cwdstuff::get): Ditto.
+ * pwdgrp.h (pwdgrp::pglock): Ditto.
+ (pwdgrp::refresh): Ditto.
+ * sigproc.cc (sync_proc_subproc): Ditto.
+ (get_proc_lock): Ditto.
+ (proc_subproc): Ditto.
+ (_cygtls::remove_wq): Ditto.
+ (proc_terminate): Ditto.
+ (sigproc_init): Ditto.
+ * timer.cc (lock_timer_tracker::protect): Ditto.
+ (lock_timer_tracker::lock_timer_tracker): Ditto.
+ (lock_timer_tracker::~lock_timer_tracker): Ditto.
+ * wininfo.cc (wininfo::_lock;): Ditto.
+ (wininfo::winthread): Ditto.
+ (operator HWND): Ditto.
+ (wininfo::lock): Ditto.
+ (wininfo::release): Ditto.
+ * wininfo.h (wininfo::_lock;): Ditto.
+
2005-04-04 Christopher Faylor <cgf@timesys.com>
* path.cc (path_conv::check): Only check for PC_NO_ACCESS_CHECK in end
* fhandler.h (enum change_state): Add.
(fhandler_base::status): Add a bit to has_changed flag.
(fhandler_base::has_changed): Implement with type change_state.
- * fhandler.cc (fhandler_base::raw_write): Accomodate type change
+ * fhandler.cc (fhandler_base::raw_write): Accommodate type change
of has_changed.
* fhandler_disk_file.cc )fhandler_disk_file::touch_ctime): Also
touch modification time if has_changed == data_changed.
(fhandler_disk_file::fchmod): Also open on 9x, otherwise we can't
- touch ctime. Accomodate type change of has_changed.
- (fhandler_disk_file::fchown): Accomodate type change of has_changed.
+ touch ctime. Accommodate type change of has_changed.
+ (fhandler_disk_file::fchown): Accommodate type change of has_changed.
(fhandler_disk_file::facl): Ditto.
(fhandler_disk_file::ftruncate): Ditto.
(fhandler_disk_file::link): Ditto.
2005-04-03 Corinna Vinschen <corinna@vinschen.de>
- * cygheap.cc (cygheap_init): Accomodate set_process_privilege change.
+ * cygheap.cc (cygheap_init): Accommodate set_process_privilege change.
* cygheap.h (cygheap_user::curr_primary_token): New member.
(cygheap_user::primary_token): New method.
(cygheap_user::deimpersonate): Always revert to processes'
(class fhandler_disk_file): Ditto.
(class fhandler_dev_mem): Ditto.
* fhandler_mem.cc (fhandler_dev_mem::fixup_mmap_after_fork):
- Accomodate new parameters.
+ Accommodate new parameters.
* mmap.cc: Include ntdll.h.
(class mmap_record): Add flags member.
(mmap_record::mmap_record): Add flags parameter.
(mmap64): Don't align offset and length to granularity in case of
MAP_ANONYMOUS on NT. Check for already existing mapping only on 9x.
Call mmap_record::mmap_record with additional flags argument.
- (fhandler_base::fixup_mmap_after_fork): Accomodate new parameters.
+ (fhandler_base::fixup_mmap_after_fork): Accommodate new parameters.
(fhandler_disk_file::mmap): Use NtMapViewOfSection with
AT_ROUND_TO_PAGE flag for anonymous mappings on NT. If addr is NULL,
try to map adjacent to previous mapping.
(fhandler_disk_file::fixup_mmap_after_fork): Add flags argument.
Change offset parameter to _off64_t. Use NtMapViewOfSection to
re-create anonymous mappings on NT.
- (fixup_mmaps_after_fork): Accomodate new parameters when calling
+ (fixup_mmaps_after_fork): Accommodate new parameters when calling
fhandler's fixup_mmaps_after_fork function.
* ntdll.h (AT_ROUND_TO_PAGE): New define.
* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Pass
dwVolumeSerialNumber from GetFileInformationByHandle to fstat_helper.
(fhandler_base::fstat_by_name): Pass pc.volser () to fstat_helper.
- Accomodate dropping default values for last three arguments of
+ Accommodate dropping default values for last three arguments of
fstat_helper.
(fhandler_base::fstat_helper): Add dwVolumeSerialNumber argument.
Use for st_dev member unless 0 in which case pc.volser () is used.
init_cygheap NO_COPY *cygheap;
void NO_COPY *cygheap_max;
-static NO_COPY muto *cygheap_protect;
+static NO_COPY muto cygheap_protect;
static NO_COPY DWORD reserve_sz;
struct cygheap_entry
cygheap_setup_for_child (child_info *ci, bool dup_later)
{
void *newcygheap;
- cygheap_protect->acquire ();
+ cygheap_protect.acquire ();
unsigned n = (char *) cygheap_max - (char *) cygheap;
unsigned size = reserve_sz;
if (size < n)
ProtectHandle1INH (ci->cygheap_h, passed_cygheap_h);
if (!dup_later)
dup_now (newcygheap, ci, n);
- cygheap_protect->release ();
+ cygheap_protect.release ();
ci->cygheap = cygheap;
ci->cygheap_max = cygheap_max;
ci->cygheap_reserve_sz = size;
/* NOTE: There is an assumption here that cygheap_max has not changed
between the time that cygheap_setup_for_child was called and now.
Make sure that this is a correct assumption. */
- cygheap_protect->acquire ();
+ cygheap_protect.acquire ();
dup_now (newcygheap, ci, (char *) cygheap_max - (char *) cygheap);
- cygheap_protect->release ();
+ cygheap_protect.release ();
}
UnmapViewOfFile (newcygheap);
ForceCloseHandle1 (ci->cygheap_h, passed_cygheap_h);
extern "C" void __stdcall
cygheap_init ()
{
- new_muto (cygheap_protect);
+ cygheap_protect.init ("cygheap_protect");
if (!cygheap)
{
init_cheap ();
for (b = 3, sz = 8; sz && sz < size; b++, sz <<= 1)
continue;
- cygheap_protect->acquire ();
+ cygheap_protect.acquire ();
if (cygheap->buckets[b])
{
rvc = (_cmalloc_entry *) cygheap->buckets[b];
rvc = (_cmalloc_entry *) _csbrk (sz + sizeof (_cmalloc_entry));
if (!rvc)
{
- cygheap_protect->release ();
+ cygheap_protect.release ();
return NULL;
}
rvc->prev = cygheap->chain;
cygheap->chain = rvc;
}
- cygheap_protect->release ();
+ cygheap_protect.release ();
return rvc->data;
}
static void __stdcall
_cfree (void *ptr)
{
- cygheap_protect->acquire ();
+ cygheap_protect.acquire ();
_cmalloc_entry *rvc = to_cmalloc (ptr);
DWORD b = rvc->b;
rvc->ptr = cygheap->buckets[b];
cygheap->buckets[b] = (char *) rvc;
- cygheap_protect->release ();
+ cygheap_protect.release ();
}
static void *__stdcall
char *win32;
DWORD hash;
DWORD drive_length;
- muto *cwd_lock;
+ static muto cwd_lock;
char *get (char *, int = 1, int = 0, unsigned = CYG_MAX_PATH);
DWORD get_hash ();
DWORD get_drive (char * dst)
{
get_initial ();
memcpy (dst, win32, drive_length);
- cwd_lock->release ();
+ cwd_lock.release ();
return drive_length;
}
void init ();
#ifndef __INSIDE_CYGWIN__
# define USE_DL_PREFIX 1
#else
-# define __malloc_lock() mallock->acquire ()
-# define __malloc_unlock() mallock->release ()
-extern muto *mallock;
+# define __malloc_lock() mallock.acquire ()
+# define __malloc_unlock() mallock.release ()
+extern muto mallock;
#endif
#ifdef __cplusplus
}
class sentry
{
- static muto *lock;
+ static muto lock;
int destroy;
public:
void init ();
- bool acquired () {return lock->acquired ();}
+ bool acquired () {return lock.acquired ();}
sentry () {destroy = 0;}
- sentry (DWORD wait) {destroy = lock->acquire (wait);}
- ~sentry () {if (destroy) lock->release ();}
+ sentry (DWORD wait) {destroy = lock.acquire (wait);}
+ ~sentry () {if (destroy) lock.release ();}
friend void _cygtls::init ();
};
-muto NO_COPY *sentry::lock;
+muto NO_COPY sentry::lock;
static size_t NO_COPY nthreads;
cygheap->threadlist = (_cygtls **) ccalloc (HEAP_TLS, cygheap->sthreads,
sizeof (cygheap->threadlist[0]));
}
- new_muto1 (sentry::lock, sentry_lock);
+ sentry::lock.init ("sentry_lock");
}
void
HANDLE NO_COPY hMainThread;
HANDLE NO_COPY hProcToken;
HANDLE NO_COPY hProcImpToken;
+muto NO_COPY dtable::lock_cs; /* This should be in dtable.cc but it causes inexplicable
+ errors there. */
bool display_title;
bool strip_title_path;
myself.exit (n);
}
-static muto *atexit_lock;
+static NO_COPY muto atexit_lock;
extern "C" int
cygwin_atexit (void (*function)(void))
{
int res;
- if (!atexit_lock)
- new_muto (atexit_lock);
- atexit_lock->acquire ();
+ atexit_lock.init ("atexit_lock");
+ atexit_lock.acquire ();
res = atexit (function);
- atexit_lock->release ();
+ atexit_lock.release ();
return res;
}
cygwin_exit (int n)
{
if (atexit_lock)
- atexit_lock->acquire ();
+ atexit_lock.acquire ();
exit (n);
}
class lock_debug
{
- static muto *locker;
+ static muto locker;
bool acquired;
public:
lock_debug () : acquired (0)
{
- if (locker && !exit_state)
- acquired = !!locker->acquire (INFINITE);
+ if (locker.name && !exit_state)
+ acquired = !!locker.acquire (INFINITE);
}
void unlock ()
{
- if (locker && acquired)
+ if (locker.name && acquired)
{
- locker->release ();
+ locker.release ();
acquired = false;
}
}
friend void debug_init ();
};
-muto NO_COPY *lock_debug::locker = NULL;
+muto NO_COPY lock_debug::locker;
static bool __stdcall mark_closed (const char *, int, HANDLE, const char *, bool);
void
debug_init ()
{
- muto *debug_lock_muto;
- lock_debug::locker = new_muto (debug_lock_muto);
+ lock_debug::locker.init ("debug_lock");
}
/* Find a registered handle in the linked list of handles. */
void
dtable::init_lock ()
{
- new_muto (lock_cs);
+ lock_cs.init ("lock_cs");
}
int
#define BFH_OPTS (PC_NULLEMPTY | PC_FULL | PC_POSIX)
class dtable
{
- muto *lock_cs;
+ static muto lock_cs;
fhandler_base **fds;
#ifdef NEWVFORK
fhandler_base **fds_on_hold;
static const int initial_archetype_size = 8;
int first_fd_for_open;
int cnt_need_fixup_before;
- void lock () {lock_cs->acquire ();}
- void unlock () {lock_cs->release ();}
+ void lock () {lock_cs.acquire ();}
+ void unlock () {lock_cs.release ();}
void init_lock ();
public:
size_t size;
/* This is set to indicate that we have already exited. */
static NO_COPY int exit_already = 0;
-static NO_COPY muto *mask_sync = NULL;
+static NO_COPY muto mask_sync;
NO_COPY static struct
{
syscall_printf ("signal %d out of range", sig);
return -1;
}
- mask_sync->acquire (INFINITE);
+ mask_sync.acquire (INFINITE);
sigset_t mask = myself->getsigmask ();
sigaddset (&mask, sig);
set_signal_mask (mask);
- mask_sync->release ();
+ mask_sync.release ();
return 0;
}
extern "C" sigset_t
set_process_mask_delta ()
{
- mask_sync->acquire (INFINITE);
+ mask_sync.acquire (INFINITE);
sigset_t newmask, oldmask;
if (_my_tls.deltamask & SIG_NONMASKABLE)
sigproc_printf ("oldmask %p, newmask %p, deltamask %p", oldmask, newmask,
_my_tls.deltamask);
myself->setsigmask (newmask);
- mask_sync->release ();
+ mask_sync.release ();
return oldmask;
}
extern "C" void __stdcall
set_signal_mask (sigset_t newmask, sigset_t oldmask)
{
- mask_sync->acquire (INFINITE);
+ mask_sync.acquire (INFINITE);
newmask &= ~SIG_NONMASKABLE;
sigset_t mask_bits = oldmask & ~newmask;
sigproc_printf ("oldmask %p, newmask %p, mask_bits %p", oldmask, newmask,
sig_dispatch_pending (true);
else
sigproc_printf ("not calling sig_dispatch_pending");
- mask_sync->release ();
+ mask_sync.release ();
return;
}
api_fatal ("can't create title mutex '%s', %E", name);
ProtectHandle (tty_mutex);
- new_muto (mask_sync);
+ mask_sync.init ("mask_sync");
windows_system_directory[0] = '\0';
(void) GetSystemDirectory (windows_system_directory, sizeof (windows_system_directory) - 2);
char *end = strchr (windows_system_directory, '\0');
{
read = &pwdgrp::read_passwd;
parse = &pwdgrp::parse_passwd;
- new_muto (pglock);
+ pglock.init ("pwd_lock");
}
pwdgrp::pwdgrp (__group32 *&gbuf) :
{
read = &pwdgrp::read_group;
parse = &pwdgrp::parse_group;
- new_muto (pglock);
+ pglock.init ("grp_lock");
}
struct __group32 *
newlib will call __malloc_lock and __malloc_unlock at appropriate
times. */
-NO_COPY muto *mallock = NULL;
+muto NO_COPY mallock;
void
malloc_init ()
{
- new_muto (mallock);
+ mallock.init ("mallock");
#ifndef MALLOC_DEBUG
/* Check if malloc is provided by application. If so, redirect all
void set_error (int);
};
+muto NO_COPY cwdstuff::cwd_lock;
+
int pcheck_case = PCHECK_RELAXED; /* Determines the case check behaviour. */
static const GUID GUID_shortcut
cwdstuff::get_hash ()
{
DWORD hashnow;
- cwd_lock->acquire ();
+ cwd_lock.acquire ();
hashnow = hash;
- cwd_lock->release ();
+ cwd_lock.release ();
return hashnow;
}
void
cwdstuff::init ()
{
- new_muto (cwd_lock);
+ cwd_lock.init ("cwd_lock");
}
/* Get initial cwd. Should only be called once in a
bool
cwdstuff::get_initial ()
{
- cwd_lock->acquire ();
+ cwd_lock.acquire ();
if (win32)
return 1;
if (win32_cwd)
{
- cwd_lock->acquire ();
+ cwd_lock.acquire ();
if (doit && !SetCurrentDirectory (win32_cwd))
{
__seterrno ();
res = 0;
out:
if (win32_cwd)
- cwd_lock->release ();
+ cwd_lock.release ();
return res;
}
strcpy (buf, "/");
}
- cwd_lock->release ();
+ cwd_lock.release ();
out:
syscall_printf ("(%s) = cwdstuff::get (%p, %d, %d, %d), errno %d",
char *buf, *lptr;
int max_lines;
bool initialized;
- muto *pglock;
+ muto pglock;
bool parse_passwd ();
bool parse_group ();
{
if (!check && initialized)
return;
- if (pglock->acquire () == 1 &&
+ if (pglock.acquire () == 1 &&
(!initialized || (check && etc::file_changed (etc_ix))))
(this->*read) ();
- pglock->release ();
+ pglock.release ();
}
pwdgrp (passwd *&pbuf);
// constructor operation at DLL startup
Static waitq waitq_head = {0, 0, 0, 0, 0, 0, 0};// Start of queue for wait'ing threads
-muto NO_COPY *sync_proc_subproc = NULL; // Control access to subproc stuff
+muto NO_COPY sync_proc_subproc; // Control access to subproc stuff
DWORD NO_COPY sigtid = 0; // ID of the signal thread
sigproc_printf ("sync_proc_subproc is NULL (1)");
return false;
}
- if (sync_proc_subproc->acquire (WPSP))
+ if (sync_proc_subproc.acquire (WPSP))
{
lastwhat = what;
return true;
}
out:
- sync_proc_subproc->release (); // Release the lock
+ sync_proc_subproc.release (); // Release the lock
out1:
sigproc_printf ("returning %d", rc);
return rc;
void
_cygtls::remove_wq (DWORD wait)
{
- if (sync_proc_subproc && sync_proc_subproc->acquire (wait))
+ if (sync_proc_subproc && sync_proc_subproc.acquire (wait))
{
for (waitq *w = &waitq_head; w->next != NULL; w = w->next)
if (w->next == &wq)
w->next = wq.next;
break;
}
- sync_proc_subproc->release ();
+ sync_proc_subproc.release ();
}
}
/* Signal processing is assumed to be blocked in this routine. */
if (nprocs)
{
- sync_proc_subproc->acquire (WPSP);
+ sync_proc_subproc.acquire (WPSP);
(void) proc_subproc (PROC_CLEARWAIT, 1);
procs[i].release ();
}
nprocs = 0;
- sync_proc_subproc->release ();
+ sync_proc_subproc.release ();
}
sigproc_printf ("leaving");
}
/* sync_proc_subproc is used by proc_subproc. It serialises
* access to the children and proc arrays.
*/
- new_muto (sync_proc_subproc);
+ sync_proc_subproc.init ("sync_proc_subproc");
create_signal_arrived ();
there are issues with malloc and fork. */
class muto
{
+public:
+ const char *name;
+private:
static DWORD exiting_thread;
LONG sync; /* Used to serialize access to this class. */
LONG waiters; /* Number of threads waiting for lock. */
LONG visits; /* Count of number of times a thread has called acquire. */
void *tls; /* Tls of lock owner. */
// class muto *next;
- const char *name;
/* The real constructor. */
- muto *init(const char *name) __attribute__ ((regparm (3)));
+ muto *init (const char *) __attribute__ ((regparm (2)));
#if 0 /* FIXME: See comment in sync.cc */
~muto ()
bool acquired () __attribute__ ((regparm (1)));
void upforgrabs () {tls = this;} // just set to an invalid address
void grab () __attribute__ ((regparm (1)));
+ operator int () const {return !!name;}
static void set_exiting_thread () {exiting_thread = GetCurrentThreadId ();}
};
-class locker
-{
- muto *room;
-public:
- locker (muto *m) {room = m; room->acquire ();}
- ~locker () {room->release ();}
-};
-
-/* Use a statically allocated buffer as the storage for a muto */
-#define new_muto(__name) \
-({ \
- static muto __name##_storage __attribute__((nocommon)) __attribute__((section(".data_cygwin_nocopy1"))); \
- __name = __name##_storage.init (#__name); \
-})
-
-/* Use a statically allocated buffer as the storage for a muto */
-#define new_muto1(__name, __storage) \
-({ \
- static muto __storage __attribute__((nocommon)) __attribute__((section(".data_cygwin_nocopy1"))); \
- __name = __storage.init (#__name); \
-})
-
-/* Use a statically allocated buffer as the storage for a muto */
-#define new_muto_name(__var, __name) \
-({ \
- static muto __var##_storage __attribute__((nocommon)) __attribute__((section(".data_cygwin_nocopy1"))); \
- __var = __var##_storage.init (__name); \
-})
#endif /*_SYNC_H*/
class lock_timer_tracker
{
- static muto *protect;
+ static muto protect;
public:
lock_timer_tracker ();
~lock_timer_tracker ();
};
-muto NO_COPY *lock_timer_tracker::protect;
+muto NO_COPY lock_timer_tracker::protect;
lock_timer_tracker::lock_timer_tracker ()
{
- new_muto (protect)->acquire ();
+ protect.init ("timer_protect")->acquire ();
}
lock_timer_tracker::~lock_timer_tracker ()
{
- protect->release ();
+ protect.release ();
}
bool
wininfo NO_COPY winmsg;
-muto NO_COPY *wininfo::_lock;
+muto NO_COPY wininfo::_lock;
int __stdcall
wininfo::process (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
WNDCLASS wc;
static NO_COPY char classname[] = "CygwinWndClass";
- _lock->grab ();
+ _lock.grab ();
/* Register the window class for the main window. */
wc.style = 0;
lock ();
if (!hwnd)
{
- _lock->upforgrabs ();
+ _lock.upforgrabs ();
cygthread *h = new cygthread (::winthread, this, "win");
h->SetThreadPriority (THREAD_PRIORITY_HIGHEST);
h->zap_h ();
void
wininfo::lock ()
{
- new_muto (_lock)->acquire ();
+ _lock.init ("wininfo_lock")->acquire ();
}
void
wininfo::release ()
{
- _lock->release ();
+ _lock.release ();
}
class wininfo
{
HWND hwnd;
- static muto *_lock;
+ static muto _lock;
public:
operator HWND ();
int __stdcall wininfo::process (HWND, UINT, WPARAM, LPARAM)