OSAL - Thread Create and Destroy
644 0 2023-3-7
Uploading and Loding Picture ...(0/1)
o(^-^)o
nate.sizemore
lvl.1

United States
Offline

Hello,

I'm working on integrating the Payload-SDK into Rust. The OSAL has thread create and thread destroy. In the create, under Linux, it is setup as pthread with ASYNC CANCEL type, and in destory pthread_cancel is called:

pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);



pthread_cancel(*(pthread_t *)task);


Rust does not have cancellable threads. Does the Payload SDK internally expect to be able to cancel a running thread at anytime, or is it OK for the Rust OSAL thread create and thread destory to not have cancel?

Thanks,
- Nate


2023-3-7
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules