Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
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
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
nexedi
MariaDB
Commits
618934cf
Commit
618934cf
authored
Jan 24, 2005
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use select for sleep instead of nanosleep for portability reasons
added make of mgmapi_logevent_example
parent
e33633c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
13 deletions
+12
-13
ndb/examples/Makefile
ndb/examples/Makefile
+2
-1
ndb/examples/ndbapi_async_example/ndbapi_async.cpp
ndb/examples/ndbapi_async_example/ndbapi_async.cpp
+5
-6
ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp
ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp
+5
-6
No files found.
ndb/examples/Makefile
View file @
618934cf
...
@@ -4,7 +4,8 @@ BIN_DIRS := ndbapi_simple_example \
...
@@ -4,7 +4,8 @@ BIN_DIRS := ndbapi_simple_example \
ndbapi_retries_example
\
ndbapi_retries_example
\
ndbapi_simple_index_example
\
ndbapi_simple_index_example
\
ndbapi_event_example
\
ndbapi_event_example
\
ndbapi_scan_example
ndbapi_scan_example
\
mgmapi_logevent_example
bins
:
$(patsubst %
,
_bins_%
,
$(BIN_DIRS))
bins
:
$(patsubst %
,
_bins_%
,
$(BIN_DIRS))
...
...
ndb/examples/ndbapi_async_example/ndbapi_async.cpp
View file @
618934cf
...
@@ -57,16 +57,15 @@
...
@@ -57,16 +57,15 @@
/**
/**
* Helper sleep function
* Helper sleep function
*/
*/
int
static
void
milliSleep
(
int
milliseconds
){
milliSleep
(
int
milliseconds
){
int
result
=
0
;
struct
timeval
sleeptime
;
struct
timespec
sleeptime
;
sleeptime
.
tv_sec
=
milliseconds
/
1000
;
sleeptime
.
tv_sec
=
milliseconds
/
1000
;
sleeptime
.
tv_nsec
=
(
milliseconds
-
(
sleeptime
.
tv_sec
*
1000
))
*
1000000
;
sleeptime
.
tv_usec
=
(
milliseconds
-
(
sleeptime
.
tv_sec
*
1000
))
*
1000000
;
result
=
nanosleep
(
&
sleeptime
,
NULL
);
select
(
0
,
0
,
0
,
0
,
&
sleeptime
);
return
result
;
}
}
/**
/**
* error printout macro
* error printout macro
*/
*/
...
...
ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp
View file @
618934cf
...
@@ -72,18 +72,17 @@
...
@@ -72,18 +72,17 @@
#include <NdbApi.hpp>
#include <NdbApi.hpp>
// Used for cout
// Used for cout
#include <iostream>
#include <iostream>
#include <stdio.h>
/**
/**
* Helper sleep function
* Helper sleep function
*/
*/
int
static
void
milliSleep
(
int
milliseconds
){
milliSleep
(
int
milliseconds
){
int
result
=
0
;
struct
timeval
sleeptime
;
struct
timespec
sleeptime
;
sleeptime
.
tv_sec
=
milliseconds
/
1000
;
sleeptime
.
tv_sec
=
milliseconds
/
1000
;
sleeptime
.
tv_nsec
=
(
milliseconds
-
(
sleeptime
.
tv_sec
*
1000
))
*
1000000
;
sleeptime
.
tv_usec
=
(
milliseconds
-
(
sleeptime
.
tv_sec
*
1000
))
*
1000000
;
result
=
nanosleep
(
&
sleeptime
,
NULL
);
select
(
0
,
0
,
0
,
0
,
&
sleeptime
);
return
result
;
}
}
...
...
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