Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cellframe-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
16
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
Show more breadcrumbs
cellframe
cellframe-sdk
Commits
0967d232
Commit
0967d232
authored
4 years ago
by
dmitriy.gerasimov
Browse files
Options
Downloads
Plain Diff
Merge branch 'feat-4515-3' into 'master'
Feat 4515 3 See merge request
!258
parents
188a4820
10e254a5
No related branches found
No related tags found
2 merge requests
!263
Master
,
!258
Feat 4515 3
Pipeline
#6633
passed with stage
in 12 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dap-sdk/net/core/dap_events_socket.c
+0
-1
0 additions, 1 deletion
dap-sdk/net/core/dap_events_socket.c
dap-sdk/net/stream/ch/dap_stream_ch.c
+10
-13
10 additions, 13 deletions
dap-sdk/net/stream/ch/dap_stream_ch.c
with
10 additions
and
14 deletions
dap-sdk/net/core/dap_events_socket.c
+
0
−
1
View file @
0967d232
...
...
@@ -149,7 +149,6 @@ dap_events_socket_t *dap_events_socket_wrap_no_add( dap_events_t *a_events,
if
(
a_sock
!=
0
&&
a_sock
!=
-
1
){
pthread_rwlock_wrlock
(
&
a_events
->
sockets_rwlock
);
#ifdef DAP_OS_WINDOWS
log_it
(
L_WARNING
,
"Hash add 0x%x"
,
ret
);
HASH_ADD
(
hh
,
a_events
->
sockets
,
socket
,
sizeof
(
SOCKET
),
ret
);
#else
HASH_ADD_INT
(
a_events
->
sockets
,
socket
,
ret
);
...
...
This diff is collapsed.
Click to expand it.
dap-sdk/net/stream/ch/dap_stream_ch.c
+
10
−
13
View file @
0967d232
...
...
@@ -51,7 +51,7 @@ static struct dap_stream_ch_table_t {
UT_hash_handle
hh
;
}
*
s_ch_table
=
NULL
;
static
pthread_
mutex
_t
s_ch_table_lock
;
static
pthread_
rwlock
_t
s_ch_table_lock
;
/**
* @brief stream_ch_init Init stream channel module
...
...
@@ -67,7 +67,7 @@ int dap_stream_ch_init()
log_it
(
L_CRITICAL
,
"Can't init stream channel packet submodule"
);
return
-
1
;
}
pthread_
mutex
_init
(
&
s_ch_table_lock
,
NULL
);
pthread_
rwlock
_init
(
&
s_ch_table_lock
,
NULL
);
log_it
(
L_NOTICE
,
"Module stream channel initialized"
);
return
0
;
}
...
...
@@ -77,7 +77,7 @@ int dap_stream_ch_init()
*/
void
dap_stream_ch_deinit
()
{
pthread_
mutex
_destroy
(
&
s_ch_table_lock
);
pthread_
rwlock
_destroy
(
&
s_ch_table_lock
);
}
/**
...
...
@@ -112,9 +112,9 @@ dap_stream_ch_t* dap_stream_ch_new(dap_stream_t* a_stream, uint8_t id)
struct
dap_stream_ch_table_t
*
l_new_ch
=
DAP_NEW_Z
(
struct
dap_stream_ch_table_t
);
l_new_ch
->
ch
=
l_ch_new
;
pthread_
mutex_
lock
(
&
s_ch_table_lock
);
pthread_
rwlock_wr
lock
(
&
s_ch_table_lock
);
HASH_ADD_PTR
(
s_ch_table
,
ch
,
l_new_ch
);
pthread_
mutex
_unlock
(
&
s_ch_table_lock
);
pthread_
rwlock
_unlock
(
&
s_ch_table_lock
);
return
l_ch_new
;
...
...
@@ -135,28 +135,25 @@ void dap_stream_ch_delete(dap_stream_ch_t *a_ch)
HASH_DELETE
(
hh_worker
,
l_stream_worker
->
channels
,
a_ch
);
pthread_rwlock_unlock
(
&
l_stream_worker
->
channels_rwlock
);
pthread_
mutex_
lock
(
&
s_ch_table_lock
);
struct
dap_stream_ch_table_t
*
l_ret
;
;
pthread_
rwlock_wr
lock
(
&
s_ch_table_lock
);
struct
dap_stream_ch_table_t
*
l_ret
;
HASH_FIND_PTR
(
s_ch_table
,
&
a_ch
,
l_ret
);
if
(
!
l_ret
)
{
pthread_
mutex
_unlock
(
&
s_ch_table_lock
);
pthread_
rwlock
_unlock
(
&
s_ch_table_lock
);
return
;
}
HASH_DEL
(
s_ch_table
,
l_ret
);
pthread_mutex_lock
(
&
a_ch
->
mutex
);
pthread_
mutex
_unlock
(
&
s_ch_table_lock
);
pthread_
rwlock
_unlock
(
&
s_ch_table_lock
);
DAP_DELETE
(
l_ret
);
if
(
a_ch
->
proc
)
if
(
a_ch
->
proc
->
delete_callback
)
a_ch
->
proc
->
delete_callback
(
a_ch
,
NULL
);
a_ch
->
stream
->
channel
[
a_ch
->
stream
->
channel_count
--
]
=
NULL
;
pthread_mutex_unlock
(
&
a_ch
->
mutex
);
pthread_mutex_destroy
(
&
a_ch
->
mutex
);
//pthread_rwlock_wrlock(&a_ch->stream->rwlock);
a_ch
->
stream
->
channel
[
a_ch
->
stream
->
channel_count
--
]
=
NULL
;
//pthread_rwlock_unlock(&a_ch->stream->rwlock);
/* fixed raise, but probably may be memory leak!
if(ch->internal){
free(ch->internal);
...
...
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