michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * vim: set ts=8 sts=4 et sw=4 tw=99: michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* michael@0: * Header for JavaScript Debugging support - Locking and threading functions michael@0: */ michael@0: michael@0: #ifndef jsd_lock_h___ michael@0: #define jsd_lock_h___ michael@0: michael@0: /* michael@0: * If you want to support threading and locking, define JSD_THREADSAFE and michael@0: * implement the functions below. michael@0: */ michael@0: michael@0: /* michael@0: * NOTE: These locks must be reentrant in the sense that they support michael@0: * nested calls to lock and unlock. michael@0: */ michael@0: michael@0: typedef struct JSDStaticLock JSDStaticLock; michael@0: michael@0: extern JSDStaticLock* michael@0: jsd_CreateLock(); michael@0: michael@0: extern void michael@0: jsd_Lock(JSDStaticLock* lock); michael@0: michael@0: extern void michael@0: jsd_Unlock(JSDStaticLock* lock); michael@0: michael@0: #ifdef DEBUG michael@0: extern bool michael@0: jsd_IsLocked(JSDStaticLock* lock); michael@0: #endif /* DEBUG */ michael@0: michael@0: extern void* michael@0: jsd_CurrentThread(); michael@0: michael@0: #endif /* jsd_lock_h___ */