mattn / mattn/mruby-thread

Can't kill thread when thread is sleeping

Open
#43 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
49
Forks
31
PR merge metrics
No merged PRs in 30d

Description

``` ruby
class TimerDemo
def start()
@timer = Thread.new() {
Thread.sleep 10
}
end

def stop()
@timer.kill()
end
end

th = TimerDemo.new()
th.start()
Thread.sleep 7
th.stop()
while true
Thread.sleep 7
end
```

After 10 seconds, it's closed by a unkown error which is from os.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the TimerDemo reproduction, especially TimerDemo#start, TimerDemo#stop, and the Thread.sleep calls. Investigate why killing a sleeping thread leads to an operating-system error; done means the reproducer can stop the thread without the later unknown error.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, ruby
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.