Commit Graph

9 Commits

Author SHA1 Message Date
Philippe Gerum 9b42b85ed8 lib: introduce element visibility attribute
Since core ABI 21, users can decide whether a new element should be
made public or private depending on the value of clone flags added to
the new long form of all element creation calls, i.e. evl_create_*().
All evl_new_*() calls become a shorthand for their respective long
form with reasonable default arguments, including private visibility.

As a shorthand, libevl also interprets a slash character leading the
name argument passed to these services as an implicit request for
creating a public element. In other words, this is the same as passing
EVL_CLONE_PUBLIC in the clone flags.

A public element appears as a cdev in the /dev/evl hierarchy, which
means that it is visible to other processes, which may share it. On
the contrary, a private element is only known from the process
creating it, although it does appear in the /sysfs hierarchy
regardless.

e.g.:

efd = evl_attach_self("/visible-thread");

total 0
crw-rw----    1 root     root      248,   1 Apr 17 11:59 clone
crw-rw----    1 root     root      246,   0 Apr 17 11:59 visible-thread

or,

efd = evl_attach_self("private-thread");

total 0
crw-rw----    1 root     root      248,   1 Apr 17 11:59 clone

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-04-18 20:43:02 +02:00
Philippe Gerum 46868bd894 include/mutex: make interface C++ friendly
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-03-26 10:20:16 +01:00
Philippe Gerum bdc3aab501 lib/mutex: introduce compact creation calls
Normal (i.e. non-recursive) mutexes timed on the monotonic clock are
the most common form of locks used by applications. Allow people to
write more compact code by providing creation calls and static
initializers aimed at building these directly:

- evl_new_mutex(), EVL_MUTEX_INITIALIZER() for PI locks timed on the
  monotonic clock.

- evl_new_mutex_any() and EVL_MUTEX_ANY_INITIALIZER() for building any
  supported type of lock (normal/recursive), specifying the protocol
  (PI/PP) and the base clock.
2019-08-19 10:22:49 +02:00
Philippe Gerum a6044094db lib/mutex: add support for recursive type 2019-08-18 16:30:47 +02:00
Philippe Gerum 5e95213578 include/mutex: clarify variable naming 2019-08-08 13:10:35 +02:00
Philippe Gerum c7c785c060 lib/event: check mutex sanity in wait ops 2019-08-07 10:10:34 +02:00
Philippe Gerum f0d37f4730 treewide: API update
Improve consistency in naming and disambiguate some calls.
2019-06-13 10:31:04 +02:00
Philippe Gerum 68dd86747c lib/monitor: split type and protocol information 2019-06-11 17:17:48 +02:00
Philippe Gerum eda7791f9b evl: rename evenless/ paths to evl/ 2019-03-10 16:25:02 +01:00