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
057660af
Commit
057660af
authored
Jan 08, 2015
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Сделал UniSetTimer в UniSetObject shared_ptr-ов
(в рамках перевода "всего и вся" на использование умных указателей из c++11).
parent
207347d9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
16 deletions
+7
-16
UniSetObject.h
include/UniSetObject.h
+4
-3
UniSetObject.cc
src/ObjectRepository/UniSetObject.cc
+3
-13
No files found.
include/UniSetObject.h
View file @
057660af
...
...
@@ -201,7 +201,7 @@ class UniSetObject:
friend
class
UniSetManager
;
friend
class
UniSetActivator
;
friend
class
ThreadCreator
<
UniSetObject
>
;
inline
pid_t
getMsgPID
()
{
return
msgpid
;
...
...
@@ -227,10 +227,11 @@ class UniSetObject:
std
::
atomic_bool
active
;
bool
threadcreate
;
UniSetTimer
*
tmr
;
std
::
shared_ptr
<
UniSetTimer
>
tmr
;
UniSetTypes
::
ObjectId
myid
;
CORBA
::
Object_var
oref
;
ThreadCreator
<
UniSetObject
>*
thr
;
std
::
shared_ptr
<
ThreadCreator
<
UniSetObject
>
>
thr
;
/*! очередь сообщений для объекта */
MessagesQueue
queueMsg
;
...
...
src/ObjectRepository/UniSetObject.cc
View file @
057660af
...
...
@@ -40,7 +40,7 @@
using
namespace
std
;
using
namespace
UniSetTypes
;
#define CREATE_TIMER
new ThrPassiveTimer();
#define CREATE_TIMER
make_shared<ThrPassiveTimer>();
// new PassiveSysTimer();
// ------------------------------------------------------------------------------------------
...
...
@@ -51,10 +51,8 @@ msgpid(0),
reg
(
false
),
active
(
0
),
threadcreate
(
false
),
tmr
(
NULL
),
myid
(
UniSetTypes
::
DefaultObjectId
),
oref
(
0
),
thr
(
NULL
),
SizeOfMessageQueue
(
1000
),
MaxCountRemoveOfMessage
(
10
),
stMaxQueueMessages
(
0
),
...
...
@@ -73,10 +71,8 @@ msgpid(0),
reg
(
false
),
active
(
0
),
threadcreate
(
true
),
tmr
(
NULL
),
myid
(
id
),
oref
(
0
),
thr
(
NULL
),
SizeOfMessageQueue
(
1000
),
MaxCountRemoveOfMessage
(
10
),
stMaxQueueMessages
(
0
),
...
...
@@ -108,10 +104,8 @@ msgpid(0),
reg
(
false
),
active
(
0
),
threadcreate
(
true
),
tmr
(
NULL
),
myid
(
UniSetTypes
::
DefaultObjectId
),
oref
(
0
),
thr
(
NULL
),
SizeOfMessageQueue
(
1000
),
MaxCountRemoveOfMessage
(
10
),
stMaxQueueMessages
(
0
),
...
...
@@ -155,11 +149,7 @@ UniSetObject::~UniSetObject()
thr
->
join
();
}
catch
(...){}
delete
thr
;
}
delete
tmr
;
}
// ------------------------------------------------------------------------------------------
void
UniSetObject
::
init_object
()
...
...
@@ -446,7 +436,7 @@ CORBA::Boolean UniSetObject::exist()
// ------------------------------------------------------------------------------------------
void
UniSetObject
::
termWaiting
()
{
if
(
tmr
!=
NULL
)
if
(
tmr
)
tmr
->
terminate
();
}
// ------------------------------------------------------------------------------------------
...
...
@@ -747,7 +737,7 @@ bool UniSetObject::activate()
if
(
myid
!=
UniSetTypes
::
DefaultObjectId
&&
threadcreate
)
{
thr
=
new
ThreadCreator
<
UniSetObject
>
(
this
,
&
UniSetObject
::
work
);
thr
=
make_shared
<
ThreadCreator
<
UniSetObject
>
>
(
this
,
&
UniSetObject
::
work
);
thr
->
start
();
}
else
...
...
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