Comments (2)
Looks like it. From glancing at it it could probably be fixed by using wake_queue_wake_one() in the thread_exit with the return code 0. Then, in the cleanup path in thread_join(), hit the wait queue with wake_queue_wake_all() with a nonzero return code, so that any other thread waiting will unblock but not try to clean it up.
It would have the property that only one of the threads would get the return code and the others would get an error message. Not super ideal, but at least it wouldn't crash.
from lk.
Exactly. We somehow need to wake up one thread (with a different error code that suggests cleanup the resources) and then the others (which should not cleanup the resources)
The other solution I can think of is, to check whether the thread data structure already exists in thread_join itself. If not null, then call free(). Or even better, reference count it.
from lk.
Related Issues (20)
- [Feature] Dual boot support HOT 4
- [libc][printf] limited number of characters support
- arch_in_int_handler not working on multicore ARCH HOT 1
- riscv sifive_u qemu port doesn't seem to have working timers/interrupts
- printf("%zd") of ssize_t variables results in a warning
- Exception occurs when SVE instructions used on aarch64
- [lib][console] unused with_history parameter when creating a new console
- Adding the `-mgeneral-regs-only` flag breaks variadic functions
- Aarch64 ILP32 LK HOT 1
- Saving FPU registers during IRQ Handler HOT 1
- Evaluate Profile-Guided Optimization (PGO) HOT 2
- Assessment of the difficulty in porting CPU architecture for lk HOT 1
- ........................... 5776-9529-3040
- [virtio/fs] Support for virtual 9p devices HOT 3
- Query regading the Translation table HOT 3
- qemu-system-riscv64 cannot start up HOT 1
- Upstreaming msm8916 SoC support
- Cortex A8 target generating SIMD code in timer_tick interrupt handler HOT 5
- buffer-underflow on _vsnprintf when len=0
- compiling VisionFive2 failed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lk.