Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
1c8c83f1
Commit
1c8c83f1
authored
Oct 31, 2014
by
Joseph Noir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove debug prints
parent
611214a1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
15 deletions
+1
-15
libcaf_core/src/condition_variable.cpp
libcaf_core/src/condition_variable.cpp
+0
-13
libcaf_core/src/thread.cpp
libcaf_core/src/thread.cpp
+1
-2
No files found.
libcaf_core/src/condition_variable.cpp
View file @
1c8c83f1
...
@@ -23,17 +23,13 @@ condition_variable::~condition_variable() {
...
@@ -23,17 +23,13 @@ condition_variable::~condition_variable() {
void
condition_variable
::
notify_one
()
noexcept
{
void
condition_variable
::
notify_one
()
noexcept
{
unsigned
old_state
=
disableIRQ
();
unsigned
old_state
=
disableIRQ
();
priority_queue_node_t
*
head
=
priority_queue_remove_head
(
&
m_queue
);
priority_queue_node_t
*
head
=
priority_queue_remove_head
(
&
m_queue
);
printf
(
"[notify_one] head is %x with data %u
\n
"
,
head
,
head
->
data
);
printf
(
"[notify_one] data %u
\n
"
,
head
->
data
);
int
other_prio
=
-
1
;
int
other_prio
=
-
1
;
if
(
head
!=
NULL
)
{
if
(
head
!=
NULL
)
{
tcb_t
*
other_thread
=
(
tcb_t
*
)
sched_threads
[
head
->
data
];
tcb_t
*
other_thread
=
(
tcb_t
*
)
sched_threads
[
head
->
data
];
printf
(
"[notify_one] other thread is %x at %x
\n
"
,
other_thread
,
head
->
data
);
if
(
other_thread
)
{
if
(
other_thread
)
{
other_prio
=
other_thread
->
priority
;
other_prio
=
other_thread
->
priority
;
sched_set_status
(
other_thread
,
STATUS_PENDING
);
sched_set_status
(
other_thread
,
STATUS_PENDING
);
}
}
printf
(
"[notify_one] setting data to -1u
\n
"
);
head
->
data
=
-
1u
;
head
->
data
=
-
1u
;
}
}
restoreIRQ
(
old_state
);
restoreIRQ
(
old_state
);
...
@@ -58,7 +54,6 @@ void condition_variable::notify_all() noexcept {
...
@@ -58,7 +54,6 @@ void condition_variable::notify_all() noexcept {
other_prio
=
max_prio
(
other_prio
,
other_thread
->
priority
);
other_prio
=
max_prio
(
other_prio
,
other_thread
->
priority
);
sched_set_status
(
other_thread
,
STATUS_PENDING
);
sched_set_status
(
other_thread
,
STATUS_PENDING
);
}
}
printf
(
"[notify_all] setting data to -1u
\n
"
);
head
->
data
=
-
1u
;
head
->
data
=
-
1u
;
}
}
restoreIRQ
(
old_state
);
restoreIRQ
(
old_state
);
...
@@ -76,17 +71,9 @@ void condition_variable::wait(unique_lock<mutex>& lock) noexcept {
...
@@ -76,17 +71,9 @@ void condition_variable::wait(unique_lock<mutex>& lock) noexcept {
n
.
data
=
sched_active_pid
;
n
.
data
=
sched_active_pid
;
n
.
next
=
NULL
;
n
.
next
=
NULL
;
printf
(
"[wait] adding node: %x with data %x
\n
"
,
&
n
,
n
.
data
);
/* the signaling thread may not hold the mutex, the queue is not thread safe */
/* the signaling thread may not hold the mutex, the queue is not thread safe */
unsigned
old_state
=
disableIRQ
();
unsigned
old_state
=
disableIRQ
();
priority_queue_add
(
&
m_queue
,
&
n
);
priority_queue_add
(
&
m_queue
,
&
n
);
printf
(
"[wait] node added: %x with data %x
\n
"
,
&
n
,
n
.
data
);
priority_queue_node_t
*
head
=
priority_queue_remove_head
(
&
m_queue
);
printf
(
"[wait] head is: %x with data %x
\n
"
,
head
,
head
->
data
);
priority_queue_add
(
&
m_queue
,
&
n
);
restoreIRQ
(
old_state
);
restoreIRQ
(
old_state
);
mutex_unlock_and_sleep
(
lock
.
mutex
()
->
native_handle
());
mutex_unlock_and_sleep
(
lock
.
mutex
()
->
native_handle
());
if
(
n
.
data
!=
-
1u
)
{
if
(
n
.
data
!=
-
1u
)
{
...
...
libcaf_core/src/thread.cpp
View file @
1c8c83f1
...
@@ -9,11 +9,10 @@ namespace caf {
...
@@ -9,11 +9,10 @@ namespace caf {
thread
::~
thread
()
{
thread
::~
thread
()
{
// not needed, as our thread is always detachted
// not needed, as our thread is always detachted
printf
(
"thread::~thread thread is dead
\n
"
);
//sched_task_exit();
//sched_task_exit();
//dINT();
//dINT();
//sched_threads[sched_active_pid] = NULL;
//sched_threads[sched_active_pid] = NULL;
sched_num_threads
--
;
--
sched_num_threads
;
//sched_set_status((tcb_t *)sched_active_thread, STATUS_STOPPED);
//sched_set_status((tcb_t *)sched_active_thread, STATUS_STOPPED);
//sched_active_thread = NULL;
//sched_active_thread = NULL;
//cpu_switch_context_exit();
//cpu_switch_context_exit();
...
...
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