-
Notifications
You must be signed in to change notification settings - Fork 672
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
Add pthread_self #591
Add pthread_self #591
Conversation
Thanks, @king6cong! However I don't believe this is the right approach to this. If we can't support |
To confirm , you mean that we should keep pthread_self out of nix or take it in in another form? 😃 |
I think we should provide a safe wrapper about
Right now there's a bunch of pthread stuff is in |
@Susurrus updated |
That looks like a step in the right direction, but tests are failing. |
@king6cong Can you also add an entry to the CHANGELOG for this? |
@Susurrus Yeah, haven't found the reason that tests fails, maybe tweak around ci setup to show failure details first. |
Do the tests pass locally for you? If you have access to a mac and can test on one too, that might point us in the right direction. |
@Susurrus Yeah, it occurred to me that I could use my x86 mac to test i686 failure. Updated, Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor issues, mostly the unix
thing needs to get sorted out.
CHANGELOG.md
Outdated
@@ -6,6 +6,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). | |||
## [Unreleased] | |||
|
|||
### Added | |||
- Added `nix::sys::pthread::test_pthread_self` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should show nix::sys::pthread::pthread_self
instead.
src/sys/mod.rs
Outdated
@@ -84,3 +84,6 @@ pub mod statfs; | |||
target_arch = "arm")), | |||
)] | |||
pub mod statvfs; | |||
|
|||
#[cfg(unix)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't all the platforms covered by nix unix
? This seems unnecessary.
test/sys/mod.rs
Outdated
@@ -12,3 +12,5 @@ mod test_uio; | |||
|
|||
#[cfg(target_os = "linux")] | |||
mod test_epoll; | |||
#[cfg(unix)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, aren't all nix
-supported platforms unix
?
@@ -0,0 +1,6 @@ | |||
use nix::sys::pthread::*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an empty line below this one.
src/sys/pthread.rs
Outdated
@@ -0,0 +1,12 @@ | |||
use libc::{self, pthread_t}; | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete one of these blank lines.
@king6cong I can't tell because the old code is gone, but what was the cause of the failures and what did you change to fix them? |
@Susurrus Updated. |
Great, thanks for clearing that up. Makes sense why it fixed things. I wanted to ask, do you have a specific use case for this that this addition is all that's required for it to work? I'm going to block this on #590, so we can be sure that all platforms are passing before adding this, so we have a little time here in case there was any missing functionality you also needed. and wanted to add from |
Can you make a new type |
Updated |
This looks good. We're going to wait until the new FreeBSD buildbot is integrated (#618) and this will be our first test. |
Slight change of plans. We're no longer waiting for #618 . |
Build succeeded |
@King6Kong Thanks for your contribution! |
No description provided.