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
270768f0
Commit
270768f0
authored
5 years ago
by
Dmitriy A. Gerasimov
Browse files
Options
Downloads
Patches
Plain Diff
[+] ready_to_read flag operation function
parent
84e0d96f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dap_stream_ch.c
+28
-0
28 additions, 0 deletions
dap_stream_ch.c
dap_stream_ch.h
+1
-0
1 addition, 0 deletions
dap_stream_ch.h
with
29 additions
and
0 deletions
dap_stream_ch.c
+
28
−
0
View file @
270768f0
...
...
@@ -115,6 +115,34 @@ void dap_stream_ch_delete(dap_stream_ch_t*ch)
//free(ch);
}
/**
* @brief dap_stream_ch_set_ready_to_read
* @param a_ch
* @param a_is_ready
*/
void
dap_stream_ch_set_ready_to_read
(
dap_stream_ch_t
*
a_ch
,
bool
a_is_ready
)
{
pthread_mutex_lock
(
&
a_ch
->
mutex
);
if
(
a_ch
->
ready_to_read
!=
a_is_ready
){
//log_it(L_DEBUG,"Change channel '%c' to %s", (char) ch->proc->id, is_ready?"true":"false");
a_ch
->
ready_to_read
=
a_is_ready
;
if
(
a_ch
->
stream
->
conn_udp
)
dap_udp_client_ready_to_read
(
a_ch
->
stream
->
conn
,
a_is_ready
);
// for stream server
else
if
(
a_ch
->
stream
->
conn
)
dap_client_remote_ready_to_read
(
a_ch
->
stream
->
conn
,
a_is_ready
);
// for stream client
else
if
(
a_ch
->
stream
->
events_socket
)
dap_events_socket_set_readable
(
a_ch
->
stream
->
events_socket
,
a_is_ready
);
}
pthread_mutex_unlock
(
&
a_ch
->
mutex
);
}
/**
* @brief dap_stream_ch_set_ready_to_write
* @param ch
* @param is_ready
*/
void
dap_stream_ch_set_ready_to_write
(
dap_stream_ch_t
*
ch
,
bool
is_ready
)
{
pthread_mutex_lock
(
&
ch
->
mutex
);
...
...
This diff is collapsed.
Click to expand it.
dap_stream_ch.h
+
1
−
0
View file @
270768f0
...
...
@@ -55,6 +55,7 @@ void dap_stream_ch_deinit();
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
);
void
dap_stream_ch_delete
(
dap_stream_ch_t
*
ch
);
...
...
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