Changeset 82453b29 in mainline


Ignore:
Timestamp:
2018-06-28T15:15:54Z (6 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
96c30c8
Parents:
061274f
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-06-27 20:11:19)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-06-28 15:15:54)
Message:

Detect when printf() printing deadlock deadlocks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/fibril_synch.c

    r061274f r82453b29  
    4444#include <stdlib.h>
    4545#include <stdio.h>
     46#include <io/kio.h>
     47
    4648#include "private/async.h"
    4749#include "private/fibril.h"
     50
     51static fibril_local bool deadlocked = false;
    4852
    4953static void optimize_execution_power(void)
     
    6266{
    6367        fibril_t *f = (fibril_t *) fibril_get_id();
     68
     69        if (deadlocked) {
     70                kio_printf("Deadlock detected while printing deadlock. Aborting.\n");
     71                abort();
     72        }
     73        deadlocked = true;
    6474
    6575        printf("Deadlock detected.\n");
Note: See TracChangeset for help on using the changeset viewer.