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
e12b4c58
Commit
e12b4c58
authored
Jan 13, 2015
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(UniSetActivator): Переделал механизм завершения процессов. Чтбоы не было "SIGSEGV"
parent
055a718a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
10 deletions
+16
-10
OmniThreadCreator.h
include/OmniThreadCreator.h
+13
-8
UniSetActivator.h
include/UniSetActivator.h
+3
-2
UniSetActivator.cc
src/ObjectRepository/UniSetActivator.cc
+0
-0
No files found.
include/OmniThreadCreator.h
View file @
e12b4c58
...
...
@@ -26,6 +26,7 @@
#define OmniThreadCreator_h_
//---------------------------------------------------------------------------
#include <omnithread.h>
#include <memory>
//----------------------------------------------------------------------------
/*! \class OmniThreadCreator
* \par
...
...
@@ -94,16 +95,20 @@ class OmniThreadCreator:
public
:
/*! прототип функции вызова */
typedef
void
(
ThreadMaster
::*
Action
)(
void
*
);
typedef
void
(
ThreadMaster
::*
Action
)();
OmniThreadCreator
(
ThreadMaster
*
m
,
Action
a
,
bool
undetached
=
false
);
~
OmniThreadCreator
(){};
OmniThreadCreator
(
const
std
::
shared_ptr
<
ThreadMaster
>&
m
,
Action
a
,
bool
undetached
=
false
);
~
OmniThreadCreator
(){}
inline
bool
isRunning
(){
return
state
()
==
omni_thread
::
STATE_RUNNING
;
}
inline
void
stop
(){
exit
(
0
);
}
inline
pid_t
getTID
(){
return
id
();
}
protected
:
void
*
run_undetached
(
void
*
x
)
{
if
(
m
)
(
m
->*
act
)(
x
);
(
m
.
get
()
->*
act
)(
);
return
(
void
*
)
0
;
}
...
...
@@ -111,20 +116,20 @@ class OmniThreadCreator:
virtual
void
run
(
void
*
arg
)
{
if
(
m
)
(
m
->*
act
)(
arg
);
(
m
.
get
()
->*
act
)(
);
}
private
:
OmniThreadCreator
();
ThreadMaster
*
m
;
std
::
shared_ptr
<
ThreadMaster
>
m
;
Action
act
;
};
//----------------------------------------------------------------------------------------
template
<
class
ThreadMaster
>
OmniThreadCreator
<
ThreadMaster
>::
OmniThreadCreator
(
ThreadMaster
*
m
,
Action
a
,
bool
undetach
)
:
OmniThreadCreator
<
ThreadMaster
>::
OmniThreadCreator
(
const
std
::
shared_ptr
<
ThreadMaster
>&
_
m
,
Action
a
,
bool
undetach
)
:
omni_thread
(),
m
(
m
),
m
(
_
m
),
act
(
a
)
{
if
(
undetach
)
...
...
include/UniSetActivator.h
View file @
e12b4c58
...
...
@@ -32,7 +32,7 @@
#include "UniSetTypes.h"
#include "UniSetObject.h"
#include "UniSetManager.h"
#include "ThreadCreator.h"
#include "
Omni
ThreadCreator.h"
//#include "OmniThreadCreator.h"
//----------------------------------------------------------------------------------------
...
...
@@ -122,10 +122,11 @@ class UniSetActivator:
void
term
(
int
signo
);
void
init
();
std
::
shared_ptr
<
ThreadCreator
<
UniSetActivator
>
>
orbthr
;
std
::
shared_ptr
<
Omni
ThreadCreator
<
UniSetActivator
>
>
orbthr
;
CORBA
::
ORB_var
orb
;
TerminateEvent_Signal
s_term
;
ost
::
AtomicCounter
orbthrIsFinished
;
bool
omDestroy
;
bool
sig
;
...
...
src/ObjectRepository/UniSetActivator.cc
View file @
e12b4c58
This diff is collapsed.
Click to expand it.
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