Conversation
michael-schwarz
left a comment
There was a problem hiding this comment.
I think this fixes the immediate issue.
For a more thorough approach: Would it be worth having something like we do for pointers, where we add an unknown_thread to the set (like we have unknown_pointer) but sill keep the threads that we have?
| | (`Thread x, `Thread y) -> `Thread (Threads.join x y) | ||
| | (`Int x, `Thread y) | ||
| | (`Thread y, `Int x) -> | ||
| `Thread y (* TODO: ignores int! *) |
There was a problem hiding this comment.
Maybe at least produce a warning here and in the other similar cases?
There was a problem hiding this comment.
Since this is now required for normal operation (where the program doesn't even do weird stuff like try to manipulate a pthread_t as an integer), then it would be confusing, because it's not a fault in the program, but just in our handling of it. And you would always see this.
It would make Also, it wouldn't save us from all the weird lattice hacks between |
|
Ugh, this doesn't even work for macOS because there |
There are many cases where we actually do the sound thing (in creating all required threads) and as long as we are not overzealous about exploiting Joining a thread id and and an int by ignoring the int means that when we call a If we add this |
Not really, if we already have an unknown function pointer somehow, then spawning a thread from it will not spawn all the functions. Just like calling an unknown function pointer doesn't call all the functions.
That only covers invalidation, but not any of the other cases |
Why would the same logic not apply for all the other cases you listed? |
The solution you proposed was "add this |
|
Ah, sorry, I should have been more specific. |
Closes #386.
Fixes three cases of top thread ID sets having appeared:
malloc-ed thread ID arrays.free.It's just hacks on top of hacks on top of hacks.