History log of /haiku/headers/private/shared/locks.h
Revision Date Author Comments
# da31c585 17-Dec-2018 Augustin Cavalier <waddlesplash@gmail.com>

shared/locks: Add RecursiveLocker.

Copied from the kernel version.


# b916156a 13-Jul-2014 Julian Harnath <julian.harnath@rwth-aachen.de>

Move libroot synchronization functions to private namespace

* Prefix lock functions with __ to mark them as private. Add
forwarding macros to keep existing code working.

* Avoids symbol name clashes with kernel lock APIs, occuring when
using kernellandemu-lib in userlandfs. Thanks to Ingo for the
suggestion.


# 7e1c4534 07-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

libroot: Add adaptive mutex implementation


# 077c84eb 05-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

kernel: atomic_*() functions rework

* No need for the atomically changed variables to be declared as
volatile.
* Drop support for atomically getting and setting unaligned data.
* Introduce atomic_get_and_set[64]() which works the same as
atomic_set[64]() used to. atomic_set[64]() does not return the
previous value anymore.


# f7127458 15-Apr-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Private libroot locking primitives:
- Reimplemented mutex to use the _kern_mutex*() syscalls.
- The initializer functions cannot fail anymore -- changed their return type
to void.
- Changed the initializer function semantics to not copy the name by default
anymore (as in the kernel). Also added *_etc() versions of them that take an
additional flags.
- Added static initializer macros.
- Made the mutex (and thus recursive_lock) lock functions non-interruptable.
- Got rid of the "lazy" version. They are no longer needed, since the
initialization of the standard types can be done statically and cannot fail.
* Adjusted libroot, runtime loader, and other code using the private libroot
locking primitives to the new semantics.
* pthreads mutexes and condition variables:
- Reimplemented using the _kern_mutex*() syscalls.
- Consistently use POSIX error codes.
- Fixed some not quite POSIX compliant behavior.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36323 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 840be9d6 01-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added __init_once(), an almost exact clone of pthread_once(), with the
difference that the initialization function has an additional void* argument,
so that it is suitable for initializing stuff in objects.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34400 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 258b34c5 30-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Fixed wrong parameter of lazy_mutex_destroy().
* Split locks.cpp into mutex.cpp, recursive_lock.cpp, and rw_lock.cpp (new
subdirectory locks/).
* runtime_loader no longer includes the rw_lock, allowing removal of the TLS
dependency again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34364 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8bef2310 29-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a lazy_recursive_lock implementation -- identical to recursive_lock,
just using a lazy_mutex instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34341 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 937b23cb 29-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added locking primitive lazy_mutex, which has essentially the same behaviour
as a mutex, but allocates its semaphore lazily. This comes at the cost of an
additional atomic_add() when the semaphore has actually to be acquired, but
saves the semaphore creation completely in single-threaded programs and in
any program when there's no lock contention.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34339 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 93b9f213 29-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added recursive lock implementation (an adapted kernel version).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34337 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 93b63126 12-Oct-2009 Michael Lotz <mmlr@mlotz.ch>

Adding mutex and rw_lock with the same interface as the kernel versions to
libroot. The mutex is a simple benaphore, the rw_lock is pretty much the same
as the one from libkernelland_emu but uses a mutex per lock instead of emulating
a global thread lock. Also added MutexLocking and RWLock{Read|Write}Locking and
AutoLockers based on them. It's cased with __cplusplus so the locks are also
usable from C. Everything's currently exposed in shared/private/locks.h but I
think we should make these locking primitves public.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33543 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b916156a835cd4f1c16990c33d69190014df77b7 13-Jul-2014 Julian Harnath <julian.harnath@rwth-aachen.de>

Move libroot synchronization functions to private namespace

* Prefix lock functions with __ to mark them as private. Add
forwarding macros to keep existing code working.

* Avoids symbol name clashes with kernel lock APIs, occuring when
using kernellandemu-lib in userlandfs. Thanks to Ingo for the
suggestion.


# 7e1c4534df199347d63bf7235ced8cc60170bfa7 07-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

libroot: Add adaptive mutex implementation


# 077c84eb27b25430428d356f3d13afabc0cc0d13 05-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

kernel: atomic_*() functions rework

* No need for the atomically changed variables to be declared as
volatile.
* Drop support for atomically getting and setting unaligned data.
* Introduce atomic_get_and_set[64]() which works the same as
atomic_set[64]() used to. atomic_set[64]() does not return the
previous value anymore.


# f71274580bc2625bf438140839fe38193ece28e6 15-Apr-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Private libroot locking primitives:
- Reimplemented mutex to use the _kern_mutex*() syscalls.
- The initializer functions cannot fail anymore -- changed their return type
to void.
- Changed the initializer function semantics to not copy the name by default
anymore (as in the kernel). Also added *_etc() versions of them that take an
additional flags.
- Added static initializer macros.
- Made the mutex (and thus recursive_lock) lock functions non-interruptable.
- Got rid of the "lazy" version. They are no longer needed, since the
initialization of the standard types can be done statically and cannot fail.
* Adjusted libroot, runtime loader, and other code using the private libroot
locking primitives to the new semantics.
* pthreads mutexes and condition variables:
- Reimplemented using the _kern_mutex*() syscalls.
- Consistently use POSIX error codes.
- Fixed some not quite POSIX compliant behavior.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36323 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 840be9d6e60b0598f87e44e68cdac4cb8fac1619 01-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added __init_once(), an almost exact clone of pthread_once(), with the
difference that the initialization function has an additional void* argument,
so that it is suitable for initializing stuff in objects.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34400 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 258b34c594867f4447c4e3b5ce9240075f48b7f4 30-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Fixed wrong parameter of lazy_mutex_destroy().
* Split locks.cpp into mutex.cpp, recursive_lock.cpp, and rw_lock.cpp (new
subdirectory locks/).
* runtime_loader no longer includes the rw_lock, allowing removal of the TLS
dependency again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34364 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8bef23107e85569f85d0658ac3a03b87401ed566 29-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a lazy_recursive_lock implementation -- identical to recursive_lock,
just using a lazy_mutex instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34341 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 937b23cb21fb13ff25df2ad8b369e42af4155111 29-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added locking primitive lazy_mutex, which has essentially the same behaviour
as a mutex, but allocates its semaphore lazily. This comes at the cost of an
additional atomic_add() when the semaphore has actually to be acquired, but
saves the semaphore creation completely in single-threaded programs and in
any program when there's no lock contention.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34339 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 93b9f2133561c46077f1a5d99f37c705d8306805 29-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added recursive lock implementation (an adapted kernel version).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34337 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 93b63126e18798d672f0782ed41c2a2b925bccf5 12-Oct-2009 Michael Lotz <mmlr@mlotz.ch>

Adding mutex and rw_lock with the same interface as the kernel versions to
libroot. The mutex is a simple benaphore, the rw_lock is pretty much the same
as the one from libkernelland_emu but uses a mutex per lock instead of emulating
a global thread lock. Also added MutexLocking and RWLock{Read|Write}Locking and
AutoLockers based on them. It's cased with __cplusplus so the locks are also
usable from C. Everything's currently exposed in shared/private/locks.h but I
think we should make these locking primitves public.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33543 a95241bf-73f2-0310-859d-f6bbb57e9c96