Skip to content
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 some pthread-related syscalls #20

Merged
merged 1 commit into from
Oct 31, 2023
Merged

Conversation

AuYang261
Copy link
Contributor

I added following syscalls:

  1. pthread_mutex_destroy
  2. pthread_cond_destroy
  3. pthread_cond_timedwait
  4. pthread-key-related functions, including:
  1. pthread_key_create
  2. pthread_key_delete
  3. pthread_getspecific
  4. pthread_setspecific

And I added test code for the above syscalls in apps/c/pthreads/basic.

@coolyjg
Copy link
Contributor

coolyjg commented Oct 20, 2023

Why this pr contains the same code as #14 ? They should be separated. Or close either of them.

@AuYang261
Copy link
Contributor Author

They really should be separated. But they should all be come after #18 for passing CI.

#18 should be merged as soon as possible, so that subsequent commits can pass the CI.

@AuYang261 AuYang261 force-pushed the pthread branch 2 times, most recently from 6ec0fe0 to 3e19b83 Compare October 23, 2023 06:19
@AuYang261
Copy link
Contributor Author

I rebased the branch to seperate each pr.

@AuYang261 AuYang261 marked this pull request as draft October 23, 2023 06:20
@AuYang261 AuYang261 marked this pull request as ready for review October 23, 2023 16:05
@AuYang261
Copy link
Contributor Author

I searched some meterial and believed that TSD and TLS are different concepts. So the implement of TSD current is not duplicated.

@coolyjg
Copy link
Contributor

coolyjg commented Oct 26, 2023

TSD is more like a libc conception rather than a kernel conception. Musl libc organizes TSD in pthread_t->tsd. Since we specially treat pthread lib, I think it's okay to follow your design.

Copy link
Contributor

@coolyjg coolyjg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change some code mentioned here, especially error handling (always remember to handle error, and print log), and please remove pthread-key-related functions test into another test file, since pthread/basic only contains tests for frequently used functions.

api/arceos_posix_api/src/imp/pthread/condvar.rs Outdated Show resolved Hide resolved
api/arceos_posix_api/src/imp/pthread/mod.rs Outdated Show resolved Hide resolved
api/arceos_posix_api/src/imp/pthread/specific.rs Outdated Show resolved Hide resolved
modules/axtask/src/task.rs Outdated Show resolved Hide resolved
modules/axtask/src/task.rs Outdated Show resolved Hide resolved
modules/axtask/src/task.rs Outdated Show resolved Hide resolved
api/arceos_posix_api/src/imp/pthread/specific.rs Outdated Show resolved Hide resolved
@coolyjg coolyjg merged commit 94309c9 into syswonder:dev Oct 31, 2023
11 checks passed
@AuYang261 AuYang261 deleted the pthread branch October 31, 2023 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants