Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
4b921a6c
Commit
4b921a6c
authored
Mar 02, 2023
by
Juan David González Cobas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
document the two locking options
parent
ef97f174
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
Makefile
libertm/Makefile
+4
-0
libertm.c
libertm/libertm.c
+5
-0
No files found.
libertm/Makefile
View file @
4b921a6c
...
...
@@ -22,6 +22,7 @@ CFLAGS += "-DGIT_URL=\"$(GIT_URL)\""
LIBS
=
$(TARGET)
.a
$(TARGET)
.so libertm_display.so
LIBOBJS
=
$(TARGET)
.o linux-uart-link.o common-uart-link.o udev-serial.o magics.o flock.o
LIBOBJS
+=
semaph.o
all
:
libs main udev-find
libs
:
$(LIBS)
...
...
@@ -45,6 +46,9 @@ ertm14-uart-link.o: $(ERTM_UART_LOCATION)/ertm14-uart-link.c
linux-uart-link.o
:
$(ERTM_BOARD_LOCATION)/common-uart-link.h
libertm.o
:
libertm.h private.h
semaph
:
semaph.o
semaph
:
LDLIBS+=-lpthread
libertm_display.so
:
display.o
$(LD)
-shared
-o
$@
$^
...
...
libertm/libertm.c
View file @
4b921a6c
...
...
@@ -234,6 +234,11 @@ struct ertm_status *ertm_init(const char *address)
errno
=
ENODEV
;
return
NULL
;
}
/* this hardcodes using file lock-based mutexes. This protects
* the critical section from concurrent processes but NOT from
* concurrent threads. In case of thread contention, use
* ertm_semaphore_mutex, implemented in semph.c based on POSIX
* semaphores */
st
->
mutex
=
ertm_flock_mutex
;
if
(
st
->
mutex
->
create
(
st
)
<
0
)
{
errno
=
ENODEV
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment