Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
59bf1d78
Commit
59bf1d78
authored
Jan 09, 2017
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(evloop): исправление ошибки с неверным типов callback-функции
parent
9ad90bb4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
CommonEventLoop.h
include/CommonEventLoop.h
+2
-2
CommonEventLoop.cc
src/Processes/CommonEventLoop.cc
+16
-4
No files found.
include/CommonEventLoop.h
View file @
59bf1d78
...
@@ -82,8 +82,8 @@ namespace uniset
...
@@ -82,8 +82,8 @@ namespace uniset
private
:
private
:
void
onStop
()
noexcept
;
void
onStop
(
ev
::
async
&
w
,
int
revents
)
noexcept
;
void
onPrepare
()
noexcept
;
void
onPrepare
(
ev
::
async
&
w
,
int
revents
)
noexcept
;
void
defaultLoop
()
noexcept
;
void
defaultLoop
()
noexcept
;
std
::
atomic_bool
cancelled
=
{
false
};
std
::
atomic_bool
cancelled
=
{
false
};
...
...
src/Processes/CommonEventLoop.cc
View file @
59bf1d78
...
@@ -52,7 +52,7 @@ namespace uniset
...
@@ -52,7 +52,7 @@ namespace uniset
}
}
{
{
std
::
lock_guard
<
std
::
mutex
>
lck
(
thr_mutex
);
std
::
lock_guard
<
std
::
mutex
>
l
o
ck
(
thr_mutex
);
if
(
!
thr
)
if
(
!
thr
)
{
{
...
@@ -128,7 +128,7 @@ namespace uniset
...
@@ -128,7 +128,7 @@ namespace uniset
if
(
!
w
)
if
(
!
w
)
return
false
;
return
false
;
std
::
lock_guard
<
std
::
mutex
>
l
(
wlist_mutex
);
std
::
lock_guard
<
std
::
mutex
>
l
ock
(
wlist_mutex
);
try
try
{
{
...
@@ -168,8 +168,14 @@ namespace uniset
...
@@ -168,8 +168,14 @@ namespace uniset
return
wlist
.
size
();
return
wlist
.
size
();
}
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
void
CommonEventLoop
::
onPrepare
()
noexcept
void
CommonEventLoop
::
onPrepare
(
ev
::
async
&
w
,
int
revents
)
noexcept
{
{
if
(
EV_ERROR
&
revents
)
{
// cerr << myname << "(CommonEventLoop::onPrepare): invalid event" << endl;
return
;
}
prep_notify
=
false
;
prep_notify
=
false
;
{
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
prep_mutex
);
std
::
lock_guard
<
std
::
mutex
>
lock
(
prep_mutex
);
...
@@ -194,8 +200,14 @@ namespace uniset
...
@@ -194,8 +200,14 @@ namespace uniset
prep_event
.
notify_all
();
prep_event
.
notify_all
();
}
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
void
CommonEventLoop
::
onStop
()
noexcept
void
CommonEventLoop
::
onStop
(
ev
::
async
&
aw
,
int
revents
)
noexcept
{
{
if
(
EV_ERROR
&
revents
)
{
// cerr << myname << "(CommonEventLoop::onStop): invalid event" << endl;
return
;
}
// здесь список не защищаем wlist_mutex
// здесь список не защищаем wlist_mutex
// потому-что onStop будет вызываться
// потому-что onStop будет вызываться
// из evstop, где он уже будет под "блокировкой"
// из evstop, где он уже будет под "блокировкой"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment