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
20
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
f2651e88
Commit
f2651e88
authored
4 years ago
by
Sergei Rashitov
Browse files
Options
Downloads
Patches
Plain Diff
[+] Add function that stops events
parent
d27598ed
No related branches found
No related tags found
1 merge request
!77
Cannot stop events
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dap-sdk/net/core/dap_events.c
+8
-1
8 additions, 1 deletion
dap-sdk/net/core/dap_events.c
dap-sdk/net/core/include/dap_events.h
+1
-0
1 addition, 0 deletions
dap-sdk/net/core/include/dap_events.h
with
9 additions
and
1 deletion
dap-sdk/net/core/dap_events.c
+
8
−
1
View file @
f2651e88
...
...
@@ -83,6 +83,7 @@
static
uint32_t
s_threads_count
=
1
;
static
size_t
s_connection_timeout
=
6000
;
static
struct
epoll_event
*
g_epoll_events
=
NULL
;
static
volatile
bool
bEventsAreActive
=
true
;
bool
s_workers_init
=
false
;
dap_worker_t
*
s_workers
=
NULL
;
...
...
@@ -291,13 +292,14 @@ static void *thread_worker_function(void *arg)
size_t
total_sent
;
int
bytes_sent
=
0
;
while
(
1
)
{
while
(
bEventsAreActive
)
{
int
selected_sockets
=
epoll_wait
(
w
->
epoll_fd
,
events
,
DAP_MAX_EPOLL_EVENTS
,
1000
);
if
(
selected_sockets
==
-
1
)
{
if
(
errno
==
EINTR
)
continue
;
log_it
(
L_ERROR
,
"Worker thread %d got errno: %d"
,
w
->
number_thread
,
errno
);
break
;
}
...
...
@@ -560,6 +562,11 @@ int dap_events_start( dap_events_t *a_events )
return
0
;
}
void
dap_events_stop
()
{
bEventsAreActive
=
false
;
}
/**
* @brief dap_events_wait
* @param sh
...
...
This diff is collapsed.
Click to expand it.
dap-sdk/net/core/include/dap_events.h
+
1
−
0
View file @
f2651e88
...
...
@@ -80,6 +80,7 @@ dap_events_t* dap_events_new( );
void
dap_events_delete
(
dap_events_t
*
sh
);
int32_t
dap_events_start
(
dap_events_t
*
sh
);
void
dap_events_stop
();
int32_t
dap_events_wait
(
dap_events_t
*
sh
);
uint32_t
dap_worker_get_index_min
(
);
...
...
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