Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-stream-ch
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cellframe
libdap-stream-ch
Commits
3bdf48f5
Commit
3bdf48f5
authored
5 years ago
by
Dmitriy A. Gerasimov
Browse files
Options
Downloads
Patches
Plain Diff
[+] Thread-safe get read/write channel state functions
parent
270768f0
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dap_stream_ch.h
+28
-0
28 additions, 0 deletions
dap_stream_ch.h
with
28 additions
and
0 deletions
dap_stream_ch.h
+
28
−
0
View file @
3bdf48f5
...
...
@@ -58,6 +58,34 @@ dap_stream_ch_t* dap_stream_ch_new( dap_stream_t * dap_stream,uint8_t id);
void
dap_stream_ch_set_ready_to_read
(
dap_stream_ch_t
*
ch
,
bool
is_ready
);
void
dap_stream_ch_set_ready_to_write
(
dap_stream_ch_t
*
ch
,
bool
is_ready
);
/**
* @brief dap_stream_ch_get_ready_to_read
* @param a_ch
* @return
*/
static
inline
bool
dap_stream_ch_get_ready_to_read
(
dap_stream_ch_t
*
a_ch
)
{
bool
l_ret
;
pthread_mutex_lock
(
&
a_ch
->
mutex
);
l_ret
=
a_ch
->
ready_to_read
;
pthread_mutex_unlock
(
&
a_ch
->
mutex
);
return
l_ret
;
}
/**
* @brief dap_stream_ch_get_ready_to_write
* @param a_ch
* @return
*/
static
inline
bool
dap_stream_ch_get_ready_to_write
(
dap_stream_ch_t
*
a_ch
)
{
bool
l_ret
;
pthread_mutex_lock
(
&
a_ch
->
mutex
);
l_ret
=
a_ch
->
ready_to_write
;
pthread_mutex_unlock
(
&
a_ch
->
mutex
);
return
l_ret
;
}
void
dap_stream_ch_delete
(
dap_stream_ch_t
*
ch
);
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment