Skip to content
Commit 5c24c79a authored by Bjarki Arge Andreasen's avatar Bjarki Arge Andreasen Committed by Anas Nashif
Browse files

modem: pipe: simplify synchronization



The design of the pipe is overly complicated compared to the
in-tree and planned future use of the pipe module.

The pipe is currently designed to protect against multiple
threads calling any API simultaineously. This is not neccesary
as only one thread ever calls open/close/transmit/receive at
once, while the notification APIs are potentially called by a
different thread.

This commit removes the synchronization of calls to the open/
close/receive/transmit APIs. It also uses a k_event for thread
safe event and state handling instead of a k_mutex and k_condvar.

The callback is proteced by a k_sem as it modified using the
attach/release APIs, which can be called simultaneously to a
thread invoking the callback.

Signed-off-by: default avatarBjarki Arge Andreasen <bjarki@arge-andreasen.me>
parent 87e1ab83
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment