Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
las3_pub
/
predictable_parallel_patterns
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
aad1db1f
authored
6 years ago
by
FritzFlorian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sleep functionality to thread wrapper.
parent
37f7753a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
lib/pls/include/pls/internal/base/thread.h
+6
-0
No files found.
lib/pls/include/pls/internal/base/thread.h
View file @
aad1db1f
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
#include <functional>
#include <functional>
#include <pthread.h>
#include <pthread.h>
#include <atomic>
#include <atomic>
#include <time.h>
#include "system_details.h"
#include "system_details.h"
...
@@ -44,6 +45,11 @@ class this_thread {
...
@@ -44,6 +45,11 @@ class this_thread {
pthread_yield
();
pthread_yield
();
}
}
static
void
sleep
(
long
microseconds
)
{
timespec
time
{
0
,
1000
*
microseconds
};
nanosleep
(
&
time
,
nullptr
);
}
/**
/**
* Retrieves the local state pointer.
* Retrieves the local state pointer.
*
*
...
...
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