#2626 closed enhancement (fixed)

Unify thread cancel/join and delete

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: 5.1
Component: score Version: 4.10
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

The rtems_task_delete() is basically a pthread_cancel() plus pthread_join(). Unify the implementation and introduce a _Thread_Cancel() and _Thread_Join() to be used by both APIs. Get rid of the Giant lock for thread delete.

Change History (20)

comment:1 Changed on May 20, 2016 at 5:56:47 AM by Sebastian Huber <sebastian.huber@…>

In e75374870375099eb097f189905be709008fb3c0/rtems:

score: Delete redundant thread life enums

This makes it easier to add more states in the future.

Update #2555.
Update #2626.

comment:2 Changed on May 20, 2016 at 5:56:57 AM by Sebastian Huber <sebastian.huber@…>

In b7f5e391c0c0e94e5958a294e5d38b1dda7332cc/rtems:

score: Add _Thread_Exit()

The goal is to make _Thread_Exit() a no-return function in follow up
patches.

Update #2555.
Update #2626.

comment:3 Changed on May 20, 2016 at 5:57:07 AM by Sebastian Huber <sebastian.huber@…>

In 270394eef82ae584477cb9c443d4a5c8e67978eb/rtems:

score: Avoid superfluous life protection

Disable thread dispatching is enough to prevent deletion of the
executing thread. There is no need for an additional life protection.

Update #2555.
Update #2626.

comment:4 Changed on May 20, 2016 at 5:57:17 AM by Sebastian Huber <sebastian.huber@…>

In 69c722f3f6ac84eca42e68eda0e1ed63fd3702e7/rtems:

score: Delete unused variable

Update #2555.
Update #2626.

comment:5 Changed on May 20, 2016 at 5:57:27 AM by Sebastian Huber <sebastian.huber@…>

In 9949d8a7d042da7ba53516300db5c34c8b9c8a31/rtems:

score: Add Thread_Change_life()

Add _Thread_Change_life_locked() as a general function to alter the
thread life state. Use it to implement _Thread_Set_life_protection() as
a first step.

Update #2555.
Update #2626.

comment:6 Changed on May 20, 2016 at 5:57:37 AM by Sebastian Huber <sebastian.huber@…>

In 7023d82ca6bdfe7e0fa1d1c10481671dd744d894/rtems:

score: Add _Thread_Raise_real_priority()

Update #2555.
Update #2626.

comment:7 Changed on May 20, 2016 at 5:57:47 AM by Sebastian Huber <sebastian.huber@…>

In c99eb50b9f66e76cdd6aa0833321550c9b9e655c/rtems:

score: Rework _Thread_Exit()

Rework _Thread_Exit() to use _Thread_Change_life_locked().

Update #2555.
Update #2626.

comment:8 Changed on May 20, 2016 at 5:57:57 AM by Sebastian Huber <sebastian.huber@…>

In 232147ddc12d45ff7872f72a790077c26fe5ca0a/rtems:

score: Add _Thread_Join() and _Thread_Cancel()

Split _Thread_Close() into _Thread_Join() and _Thread_Cancel() to
prepare for a re-use in pthread_join() and pthread_cancel().

Update #2555.
Update #2626.

comment:9 Changed on May 20, 2016 at 5:58:07 AM by Sebastian Huber <sebastian.huber@…>

In 9a99ce15d0878d847b4c7e054eb2996a9f5fbc34/rtems:

score: Add _Thread_Set_state_locked()

This makes it possible to do thread state and thread life changes
together under protection of the thread state lock.

Update #2555.
Update #2626.

comment:10 Changed on May 20, 2016 at 5:58:17 AM by Sebastian Huber <sebastian.huber@…>

In f410ea82a4b9d5609ce170d2aa09027b5a7c4c50/rtems:

score: Add _Thread_Clear_state_locked()

This makes it possible to do thread state and thread life changes
together under protection of the thread state lock.

Update #2555.
Update #2626.

comment:11 Changed on May 20, 2016 at 5:58:27 AM by Sebastian Huber <sebastian.huber@…>

In 0475cca9a015a7b43209270ca6e40aebf177639a/rtems:

score: Add _Thread_Dispatch_disable_with_CPU()

Update #2555.
Update #2626.

comment:12 Changed on May 20, 2016 at 5:58:37 AM by Sebastian Huber <sebastian.huber@…>

In 938839077741d2eac82d9d86705c16e0b9de8379/rtems:

score: Split _Thread_Restart()

Split _Thread_Restart() into _Thread_Restart_self() and
_Thread_Restart_other(). Move content of existing
_Thread_Restart_self() into new _Thread_Restart_self(). Avoid Giant
lock for thread restart. _Thread_Restart_self() is a no-return function
and used by _Thread_Global_construction().

Update #2555.
Update #2626.

comment:13 Changed on May 20, 2016 at 5:58:47 AM by Sebastian Huber <sebastian.huber@…>

In 862a0eeb1197539c0e69381cb5aaccb9e1c64c0f/rtems:

score: Rework _Thread_Restart_other()

Rework _Thread_Restart_other() to use _Thread_Change_life_locked().
Cope with concurrent change requests by means of a pending request
counter.

Update #2555.
Update #2626.

comment:14 Changed on May 20, 2016 at 5:58:58 AM by Sebastian Huber <sebastian.huber@…>

In ef09017ebb6ac9c1309df4e827b240c14e6dbaa9/rtems:

score: Rework _Thread_Cancel()

Rework _Thread_Cancel() to use _Thread_Change_life_locked().

Update #2555.
Update #2626.

comment:15 Changed on May 20, 2016 at 5:59:08 AM by Sebastian Huber <sebastian.huber@…>

In 29e1ecab875c3121357f27e0676913d9ca96183f/rtems:

score: Simplify _Thread_Life_action_handler()

Use _Thread_Change_life_locked() to avoid duplicated code. Avoid Giant
lock in _Thread_Life_action_handler().

Update #2555.
Update #2626.

comment:16 Changed on May 20, 2016 at 5:59:18 AM by Sebastian Huber <sebastian.huber@…>

In 54550e048d3a49435912797d2024f80671e93267/rtems:

posix: Rework pthread_join()

Rework pthread_join() to use _Thread_Join().

Close #2402.
Update #2555.
Update #2626.
Close #2714.

comment:17 Changed on May 20, 2016 at 5:59:39 AM by Sebastian Huber <sebastian.huber@…>

In da82656065d09f7b6aa411ba361287afdd787204/rtems:

posix: Rework thread cancellation

Add Thread_Life_state::THREAD_LIFE_CHANGE_DEFERRED and rework the POSIX
thread cancellation to use the thread life states.

Update #2555.
Update #2626.

comment:18 Changed on May 20, 2016 at 6:18:58 AM by Sebastian Huber

Resolution: fixed
Status: newclosed

comment:19 Changed on May 11, 2017 at 7:31:02 AM by Sebastian Huber

Milestone: 4.124.12.0

comment:20 Changed on Nov 9, 2017 at 6:27:14 AM by Sebastian Huber

Milestone: 4.12.05.1

Milestone renamed

Note: See TracTickets for help on using tickets.