Rev 4513 | Rev 4528 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4513 | Rev 4522 | ||
---|---|---|---|
Line 314... | Line 314... | ||
314 | futex_up(&fibril_futex); |
314 | futex_up(&fibril_futex); |
315 | } |
315 | } |
316 | 316 | ||
317 | /** Return fibril id of the currently running fibril. |
317 | /** Return fibril id of the currently running fibril. |
318 | * |
318 | * |
319 | * @return Fibril ID of the currently running fibril. |
319 | * @return fibril ID of the currently running fibril. |
- | 320 | * |
|
320 | */ |
321 | */ |
321 | fid_t fibril_get_id(void) |
322 | fid_t fibril_get_id(void) |
322 | { |
323 | { |
323 | return (fid_t) __tcb_get()->fibril_data; |
324 | return (fid_t) __tcb_get()->fibril_data; |
324 | } |
325 | } |
325 | 326 | ||
326 | /** Disable preemption |
327 | /** Disable preemption |
327 | * |
328 | * |
328 | * If the fibril wants to send several message in a row and does not want to be |
329 | * If the fibril wants to send several message in a row and does not want to be |
329 | * preempted, it should start async_serialize_start() in the beginning of |
330 | * preempted, it should start async_serialize_start() in the beginning of |
330 | * communication and async_serialize_end() in the end. If it is a true |
331 | * communication and async_serialize_end() in the end. If it is a true |
331 | * multithreaded application, it should protect the communication channel by a |
332 | * multithreaded application, it should protect the communication channel by a |
332 | * futex as well. Interrupt messages can still be preempted. |
333 | * futex as well. |
- | 334 | * |
|
333 | */ |
335 | */ |
334 | void fibril_inc_sercount(void) |
336 | void fibril_inc_sercount(void) |
335 | { |
337 | { |
336 | serialization_count++; |
338 | serialization_count++; |
337 | } |
339 | } |