323fa3b5ac
core/mutex: fix typo in documentation
2020-12-29 11:48:48 +01:00
Marian Buschsieweke
8bbe56c302
core/mutex: compatibility with non-C languages
...
Due to limited compatibility with C, we cannot use the inline mutex_trylock
implementation for C++. Instead, we provide a mutex_trylock_ffi() intended for
foreign function interfaces. This should also benefit rust users.
2020-12-09 11:53:48 +01:00
Marian Buschsieweke
472d6d0abc
core/mutex: fix documentation
2020-12-08 23:04:16 +01:00
Marian Buschsieweke
df66dd0272
core/mutex: uncrustify
2020-12-08 14:50:50 +01:00
Marian Buschsieweke
e348407888
core/mutex: Add mutex_cancel() & mutex_lock_cancelable()
...
Add a version of `mutex_lock()` that can be canceled with the obvious name
`mutex_lock_cancelable()`. This function returns `0` on success, and
`-ECANCELED` when the calling thread was unblocked via a call to
`mutex_cancel()` (and hence without obtaining the mutex).
This is intended to simplify the implementation of `xtimer_mutex_lock_timeout()`
and to implement `ztimer_mutex_lock_timeout()`.
2020-12-08 14:50:49 +01:00
Marian Buschsieweke
a06a7978d3
core/mutex: clean up mutex_lock()
...
- Split out handling of the blocking code path of mutex_lock() into a static
`_block()` function. This improves readability a bit and will ease review of
a follow up PR.
- Return `void` instead of `int`.
2020-11-18 11:58:49 +01:00
Marian Buschsieweke
d760e931ae
core/mutex: Cleanup
...
- Use static inline function for `mutex_try_lock()`
- The implementation is trivial enough with the inline-able IRQ API to just
always be inline-ed
- Rename `_mutex_lock()` to `mutex_lock()` and drop the blocking parameter
- This was possible to the stand-alone `mutex_try_lock()` implementation
- This yields a measurable performance bump
2020-11-06 23:27:13 +01:00
Marian Buschsieweke
876d500846
core/mutex: improve documentation
2020-11-06 18:23:26 +01:00
8efe5960aa
core: uncrustify
2020-03-30 17:02:08 +02:00
JulianHolzwarth
dd6e51b1eb
core/mutex.c _mutex_lock uses an int pointer
...
_mutex_lock uses a volatile int pointer for the parameter blocking instead of an int.
2020-03-26 17:26:07 +01:00
Sebastian Meiling
81e293422c
doxygen: refine core_sync grouping
...
- Move `@defgroup core_sync` group definition to doc.txt
- Adapt usage of `@ingroup core_sync` accordingly
2019-01-09 08:42:59 +01:00
Joakim Nohlgård
1fdfa6480d
core/mutex: fix -fpermissive warning in C++ mode
...
g++ gives the error message "error: invalid conversion from ‘void*’ to
‘list_node*’ [-fpermissive]"
2018-03-25 09:11:26 +02:00
Joakim Nohlgård
d322af3fe5
core/include/mutex.h: remove unused #include "atomic.h"
2017-02-08 16:23:47 +01:00
Oleg Hahm
7ee7801c10
*: remove trailing underscores from header guards
2017-01-19 18:30:53 +01:00
Oleg Hahm
d8574c15e9
doc: core: exclude MUTEX_LOCKED from documentation
2017-01-16 18:04:04 +01:00
Victor Arino
ea12433a8d
core/mutex: support locked initialization
2016-12-14 10:24:45 +01:00
350c341ce1
core: mutex: use of intrusive linked list instead of priority queue
2016-03-29 21:50:17 +02:00
Joakim Gebart
748499b737
core/mutex: Use atomic_int_t for lock variable.
2015-05-26 21:23:48 +02:00
Joakim Gebart
13832d8e62
everything: Remove filename from @file Doxygen command
2015-05-22 07:34:41 +02:00
altairpearl
a409191b71
core: Updated include guards to remove leading underscores
2015-03-30 06:10:58 +05:30
BytesGalore
74161f0f2d
core: moved #include
s outside the extern "C"
guards
2014-10-21 13:46:04 +02:00
Pham Huu Dang Nhat
2ded32dee7
c++: core: add extern C in header files
2014-10-09 06:18:16 +07:00
Ludwig Ortmann
b7992922ce
fix license headers in non-.c files
2014-08-23 16:16:26 +02:00
Ludwig Ortmann
c2b2e4554b
core/queue: queue -> priority_queue
...
Rename queue to priority queue, because that's what it is.
2014-08-05 17:57:45 +02:00
Ludwig Ortmann
2e190d21ed
doc: fix spelling in core/include
2014-08-05 17:08:53 +02:00
René Kijewski
4032a22719
queue: add queue_t root type
2014-07-30 21:10:22 +02:00
Ludwig Ortmann
ce4aaa6970
doc: little mutex.h fixes
...
- a university is not an author
- move internal tags to the right place
2014-07-29 14:37:41 +02:00
René Kijewski
e03e20b7f6
core: simplify mutex initializer
2014-07-29 09:33:23 +02:00
René Kijewski
e5d6142823
core: simplify mutex signatures
2014-07-29 09:32:16 +02:00
Martin Lenders
71a632520b
Fix documentation for mutex.h
2014-05-13 08:33:38 +02:00
Martin
05f085d51a
add mutex_unlock_and_sleep()
2014-03-03 18:48:35 +01:00
Martin
ff36df6847
migrated tcb.h include to .c file
2014-02-18 12:50:30 +01:00
Hauke Petersen
3785fe956b
Fixed doxygen comments, focused on file headers and group definitions
2013-12-16 14:00:24 +01:00
Oleg Hahm
39a4dc684e
fixes for #62 : eliminate unused parameter warnings
...
NOTE: this commit introduces a kernel API change for mutex_unlock
2013-08-04 04:10:33 +02:00
Oliver Hahm
ffeb6f8523
fixed coding conventions (correctly this time)
2013-06-20 18:18:29 +02:00
Oleg Hahm
2ed63bd5c6
* removed outdated (and probably confusing) FeuerWhere project as an author
2013-03-08 11:30:23 +01:00
91ae1eb6fd
* import from old firekernel repository
2010-09-22 15:10:42 +02:00