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
d7088d90
Commit
d7088d90
authored
Jun 14, 2011
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed select() bug and static initialization/deinitialization
parent
7023a997
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
298 additions
and
254 deletions
+298
-254
cppa/detail/mailman.hpp
cppa/detail/mailman.hpp
+2
-0
src/mailman.cpp
src/mailman.cpp
+18
-12
src/post_office.cpp
src/post_office.cpp
+278
-242
No files found.
cppa/detail/mailman.hpp
View file @
d7088d90
...
...
@@ -93,6 +93,8 @@ class mailman_job
};
void
mailman_loop
();
util
::
single_reader_queue
<
mailman_job
>&
mailman_queue
();
}}
// namespace cppa::detail
...
...
src/mailman.cpp
View file @
d7088d90
#include <atomic>
#include <iostream>
#include <boost/thread.hpp> // boost::barrier
#include "cppa/to_string.hpp"
#include "cppa/detail/mailman.hpp"
#include "cppa/binary_serializer.hpp"
#include "cppa/detail/post_office.hpp"
#define DEBUG(arg) std::cout << arg << std::endl
//#define DEBUG(arg) std::cout << arg << std::endl
#define DEBUG(unused) //
// forward declaration
namespace
cppa
{
namespace
detail
{
namespace
{
void
mailman_loop
();
}
}
}
// static helper
// static queue helper
namespace
{
/*
struct mailman_manager
{
typedef cppa::util::single_reader_queue<cppa::detail::mailman_job> queue_t;
boost
::
thread
*
m_loop
;
queue_t
*
m_queue
;
boost::barrier m_init_handshake;
boost::barrier m_shutdown_handshake;
queue_t m_queue;
mailman_manager()
{
...
...
@@ -36,6 +38,7 @@ struct mailman_manager
}
s_mailman_manager;
*/
}
// namespace <anonymous>
// implementation of mailman.hpp
...
...
@@ -106,16 +109,18 @@ mailman_job::~mailman_job()
}
}
/*
// implemented in post_office.cpp
util::single_reader_queue<mailman_job>& mailman_queue()
{
return
*
(
s_mailman_manager
.
m_queue
);
return *s_queue;
//return *(s_mailman_manager.m_queue);
}
*/
}
}
// namespace cppa::detail
namespace
cppa
{
namespace
detail
{
namespace
{
void
mailman_loop
()
{
// delete s_queue if mailman_loop exits
// serializes outgoing messages
binary_serializer
bs
;
// current active job
...
...
@@ -215,4 +220,5 @@ void mailman_loop()
delete
job
;
}
}
}
}
}
// namespace cppa::detail::<anonymous>
}
}
// namespace cppa::detail
src/post_office.cpp
View file @
d7088d90
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