Changeset eae664e in rtems-libbsd for rtemsbsd/rtems/rtems-kernel-muteximpl.c


Ignore:
Timestamp:
Mar 12, 2018, 1:38:46 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, 5-freebsd-12, 6-freebsd-12, master
Children:
67c35b9
Parents:
2275776
git-author:
Sebastian Huber <sebastian.huber@…> (03/12/18 13:38:46)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/13/18 10:27:11)
Message:

mutex: Use panic() after ISR lock release

Using panic() with interrupts disabled could lead to an additional error
(INTERNAL_ERROR_BAD_THREAD_DISPATCH_ENVIRONMENT) due to a potentially
blocking output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rtemsbsd/rtems/rtems-kernel-muteximpl.c

    r2275776 reae664e  
    88
    99/*
    10  * Copyright (c) 2014, 2016 embedded brains GmbH.  All rights reserved.
     10 * Copyright (c) 2014, 2018 embedded brains GmbH.  All rights reserved.
    1111 *
    1212 *  embedded brains GmbH
     
    4949{
    5050        if (owner == executing) {
    51                 BSD_ASSERT(lock->lo_flags & LO_RECURSABLE);
     51                if ((lock->lo_flags & LO_RECURSABLE) == 0) {
     52                        _Thread_queue_Release(&m->queue, queue_context);
     53                        panic("mutex lock: %s: not LO_RECURSABLE\n",
     54                            m->queue.Queue.name);
     55                }
     56
    5257                ++m->nest_level;
    53 
    5458                _Thread_queue_Release(&m->queue, queue_context);
    5559        } else {
Note: See TracChangeset for help on using the changeset viewer.