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
5dfa1766
Commit
5dfa1766
authored
Jan 27, 2014
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Оптимизация): спорный способ: отказался от mutex, для "не критиной" переменной.…
(Оптимизация): спорный способ: отказался от mutex, для "не критиной" переменной. Просто сделал её atomic.
parent
8cc62046
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
22 deletions
+8
-22
UniSetObject.h
include/UniSetObject.h
+4
-4
UniSetObject.cc
src/ObjectRepository/UniSetObject.cc
+4
-18
No files found.
include/UniSetObject.h
View file @
5dfa1766
...
...
@@ -184,8 +184,8 @@ class UniSetObject:
*/
virtual
void
cleanMsgQueue
(
MessagesQueue
&
q
);
bool
isActive
();
void
setActive
(
bool
set
);
inline
bool
isActive
(){
return
active
;
}
inline
void
setActive
(
bool
set
){
active
=
set
?
1
:
0
;
}
UniSetTypes
::
VoidMessage
msg
;
UniSetManager
*
mymngr
;
...
...
@@ -219,8 +219,8 @@ class UniSetObject:
pid_t
msgpid
;
// pid потока обработки сообщений
bool
reg
;
bool
active
;
UniSetTypes
::
uniset_rwmutex
mutex_act
;
UniSetTypes
::
mutex_atomic_t
active
;
//
UniSetTypes::uniset_rwmutex mutex_act;
bool
threadcreate
;
UniSetTimer
*
tmr
;
UniSetTypes
::
ObjectId
myid
;
...
...
src/ObjectRepository/UniSetObject.cc
View file @
5dfa1766
...
...
@@ -49,7 +49,7 @@ ui(UniSetTypes::DefaultObjectId),
mymngr
(
NULL
),
msgpid
(
0
),
reg
(
false
),
active
(
false
),
active
(
0
),
threadcreate
(
false
),
tmr
(
NULL
),
myid
(
UniSetTypes
::
DefaultObjectId
),
...
...
@@ -71,7 +71,7 @@ ui(id),
mymngr
(
NULL
),
msgpid
(
0
),
reg
(
false
),
active
(
false
),
active
(
0
),
threadcreate
(
true
),
tmr
(
NULL
),
myid
(
id
),
...
...
@@ -106,7 +106,7 @@ ui(UniSetTypes::DefaultObjectId),
mymngr
(
NULL
),
msgpid
(
0
),
reg
(
false
),
active
(
false
),
active
(
0
),
threadcreate
(
true
),
tmr
(
NULL
),
myid
(
UniSetTypes
::
DefaultObjectId
),
...
...
@@ -147,7 +147,7 @@ void UniSetObject::init_object()
{
qmutex
.
setName
(
myname
+
"_qmutex"
);
refmutex
.
setName
(
myname
+
"_refmutex"
);
mutex_act
.
setName
(
myname
+
"_mutex_act"
);
//
mutex_act.setName(myname + "_mutex_act");
SizeOfMessageQueue
=
conf
->
getArgPInt
(
"--uniset-object-size-message-queue"
,
conf
->
getField
(
"SizeOfMessageQueue"
),
1000
);
MaxCountRemoveOfMessage
=
conf
->
getArgInt
(
"--uniset-object-maxcount-remove-message"
,
conf
->
getField
(
"MaxCountRemoveOfMessage"
));
...
...
@@ -727,8 +727,6 @@ bool UniSetObject::activate()
poa
->
activate_object_with_id
(
oid
,
this
);
}
{
UniSetTypes
::
uniset_rwmutex_wrlock
lock
(
refmutex
);
oref
=
poa
->
servant_to_reference
(
static_cast
<
PortableServer
::
ServantBase
*>
(
this
)
);
...
...
@@ -881,16 +879,4 @@ bool UniSetObject::PriorVMsgCompare::operator()(const UniSetTypes::VoidMessage&
return
lhs
.
priority
<
rhs
.
priority
;
}
// ------------------------------------------------------------------------------------------
void
UniSetObject
::
setActive
(
bool
set
)
{
uniset_rwmutex_wrlock
l
(
mutex_act
);
active
=
set
;
}
// ------------------------------------------------------------------------------------------
bool
UniSetObject
::
isActive
()
{
uniset_rwmutex_rlock
l
(
mutex_act
);
return
active
;
}
// ------------------------------------------------------------------------------------------
#undef CREATE_TIMER
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