Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
a8f11b3c
Commit
a8f11b3c
authored
Feb 14, 2015
by
evoskuil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add clock_gettime implementation for OSX.
parent
6630f196
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
0 deletions
+34
-0
clock.cpp
src/clock.cpp
+22
-0
clock.hpp
src/clock.hpp
+10
-0
condition_variable.hpp
src/condition_variable.hpp
+1
-0
mailbox_safe.cpp
src/mailbox_safe.cpp
+1
-0
No files found.
src/clock.cpp
View file @
a8f11b3c
...
...
@@ -42,6 +42,28 @@
#include <time.h>
#endif
#if defined ZMQ_HAVE_OSX
#include <mach/clock.h>
#include <mach/mach.h>
#include <time.h>
#include <sys/time.h>
int
clock_gettime
(
int
clock_id
,
timespec
*
ts
)
{
// The clock_id specified is not supported on this system.
if
(
clock_id
!=
CLOCK_REALTIME
)
return
EINVAL
;
clock_serv_t
cclock
;
mach_timespec_t
mts
;
host_get_clock_service
(
mach_host_self
(),
CALENDAR_CLOCK
,
&
cclock
);
clock_get_time
(
cclock
,
&
mts
);
mach_port_deallocate
(
mach_task_self
(),
cclock
);
ts
->
tv_sec
=
mts
.
tv_sec
;
ts
->
tv_nsec
=
mts
.
tv_nsec
;
}
#endif
#ifdef ZMQ_HAVE_WINDOWS
typedef
ULONGLONG
(
*
f_compatible_get_tick_count64
)();
...
...
src/clock.hpp
View file @
a8f11b3c
...
...
@@ -22,6 +22,16 @@
#include "stdint.hpp"
#if defined ZMQ_HAVE_OSX
#include <mach/clock.h>
#include <mach/mach.h>
#include <time.h>
#include <sys/time.h>
int
clock_gettime
(
int
clock_id
,
timespec
*
ts
);
#define CLOCK_REALTIME 0
#define HAVE_CLOCK_GETTIME
#endif
namespace
zmq
{
...
...
src/condition_variable.hpp
View file @
a8f11b3c
...
...
@@ -21,6 +21,7 @@
#define __ZMQ_CONDITON_VARIABLE_HPP_INCLUDED__
#include "platform.hpp"
#include "clock.hpp"
#include "err.hpp"
#include "mutex.hpp"
...
...
src/mailbox_safe.cpp
View file @
a8f11b3c
...
...
@@ -18,6 +18,7 @@
*/
#include "mailbox_safe.hpp"
#include "clock.hpp"
#include "err.hpp"
zmq
::
mailbox_safe_t
::
mailbox_safe_t
(
mutex_t
*
sync_
)
:
...
...
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