-
Notifications
You must be signed in to change notification settings - Fork 210
Add statement_timeout= method
#463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 21 commits
6c4e155
046bd67
11a94dc
50f1ef0
c6bf834
3681b2a
c0d5144
e3f95ca
3ebee19
b819265
3ba847c
870f3b9
bf1f0e6
c8007e7
ae76a01
cd47d9b
13d4067
31e44c1
bd0267e
6456dec
832fe6a
c80aeef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| #define timespecclear(tsp) (tsp)->tv_sec = (tsp)->tv_nsec = 0 | ||
| #define timespecisset(tsp) ((tsp)->tv_sec || (tsp)->tv_nsec) | ||
| #define timespecisvalid(tsp) \ | ||
| ((tsp)->tv_nsec >= 0 && (tsp)->tv_nsec < 1000000000L) | ||
| #define timespeccmp(tsp, usp, cmp) \ | ||
| (((tsp)->tv_sec == (usp)->tv_sec) ? \ | ||
| ((tsp)->tv_nsec cmp (usp)->tv_nsec) : \ | ||
| ((tsp)->tv_sec cmp (usp)->tv_sec)) | ||
| #define timespecsub(tsp, usp, vsp) \ | ||
| do { \ | ||
| (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \ | ||
| (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ | ||
| if ((vsp)->tv_nsec < 0) { \ | ||
| (vsp)->tv_sec--; \ | ||
| (vsp)->tv_nsec += 1000000000L; \ | ||
| } \ | ||
| } while (0) | ||
| #define timespecafter(tsp, usp) \ | ||
| (((tsp)->tv_sec > (usp)->tv_sec) || \ | ||
| ((tsp)->tv_sec == (usp)->tv_sec && (tsp)->tv_nsec > (usp)->tv_nsec)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TBH, I wasn't sure how best to handle this. Is there a single header file I can try to include that will have these methods defined? How do I conditionally include a header file by whether or not that file exists? And then, do I need to ensure that all methods are present? And If you have any guidance on how you want to conditionally define this stuff, I'm happy to give it a try. I ended up just deciding that it wasn't much code to bring in, it is pretty clear what it does, and if we own that code, we can guarantee behavior.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You use https://ruby-doc.org/stdlib-2.5.1/libdoc/mkmf/rdoc/MakeMakefile.html#method-i-have_header |
||
Uh oh!
There was an error while loading. Please reload this page.