kernel: Workaround for double lock of spinlock in user timers.
The thread that is being [un]scheduled already has its time_lock locked
in {stop|continue}_cpu_timers(). When updating the TeamTimeUserTimer,
the team is asked for its cpu time. Team::CPUTime() then iterates the
threads of the team and locks the time_lock of the thread again.
This workaround passes a possibly locked thread through the relevant
functions so Team::CPUTime() can decide whether or not a thread it
iterates needs to be locked or not.
This works around #11032 and its duplicates #11314 and #11344.
This commit is contained in:
@@ -117,14 +117,16 @@ struct TeamTimeUserTimer : public UserTimer {
|
||||
|
||||
void Deactivate();
|
||||
|
||||
void Update(Thread* unscheduledThread);
|
||||
void Update(Thread* unscheduledThread,
|
||||
Thread* lockedThread = NULL);
|
||||
void TimeWarped(bigtime_t changedBy);
|
||||
|
||||
protected:
|
||||
virtual void HandleTimer();
|
||||
|
||||
private:
|
||||
void _Update(bool unscheduling);
|
||||
void _Update(bool unscheduling,
|
||||
Thread* lockedThread = NULL);
|
||||
|
||||
private:
|
||||
team_id fTeamID;
|
||||
|
||||
Reference in New Issue
Block a user