Changeset e0e2264 in mainline
- Timestamp:
- 2025-01-12T15:38:16Z (15 hours ago)
- Branches:
- master
- Parents:
- 82ff0a1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/thread/fibril_synch.c
r82ff0a1 re0e2264 1 1 /* 2 * Copyright (c) 2025 Jiri Svoboda 2 3 * Copyright (c) 2009 Jakub Jermar 3 4 * All rights reserved. … … 112 113 #define AWAITER_INIT { .fid = fibril_get_id() } 113 114 114 static void print_deadlock(fibril_owner_info_t *oi) 115 /** Print deadlock message nad blocking chain. 116 * 117 * @param oi Owner info for the resource being acquired 118 * @param f Fibril that is trying to acquire the resource 119 */ 120 static void print_deadlock(fibril_owner_info_t *oi, fibril_t *f) 115 121 { 116 122 // FIXME: Print to stderr. 117 118 fibril_t *f = (fibril_t *) fibril_get_id();119 123 120 124 if (deadlocked) { … … 143 147 } 144 148 145 static void check_fibril_for_deadlock(fibril_owner_info_t *oi, fibril_t *fib) 146 { 149 /** Check whether fibril trying to acquire a resource will cause deadlock. 150 * 151 * @param wanted_oi Owner info for the primitive that the fibril wants 152 * @param fib Fibril that wants to aquire the primitive 153 */ 154 static void check_fibril_for_deadlock(fibril_owner_info_t *wanted_oi, 155 fibril_t *fib) 156 { 157 fibril_owner_info_t *oi; 158 147 159 futex_assert_is_locked(&fibril_synch_futex); 148 160 161 oi = wanted_oi; 149 162 while (oi && oi->owned_by) { 150 163 if (oi->owned_by == fib) { 151 164 futex_unlock(&fibril_synch_futex); 152 print_deadlock( oi);165 print_deadlock(wanted_oi, fib); 153 166 abort(); 154 167 } … … 157 170 } 158 171 172 /** Check whether trying to acquire a resource will cause deadlock. 173 * 174 * @param oi Owner info for the primitive that the current fibril wants 175 */ 159 176 static void check_for_deadlock(fibril_owner_info_t *oi) 160 177 {
Note:
See TracChangeset
for help on using the changeset viewer.