Changeset c11ee605 in mainline for uspace/srv/hid/display/display.c


Ignore:
Timestamp:
2020-05-11T15:36:46Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
83cb672
Parents:
e49b7997
Message:

Display server needs some locking

Sometimes destroying a window would race with event delivery. We add
one big lock for the display object that is taken before servicing
any client request or input event.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/display.c

    re49b7997 rc11ee605  
    6565        }
    6666
     67        fibril_mutex_initialize(&disp->lock);
    6768        list_initialize(&disp->clients);
    6869        disp->next_wnd_id = 1;
     
    8485        gfx_color_delete(disp->bg_color);
    8586        free(disp);
     87}
     88
     89/** Lock display.
     90 *
     91 * This should be called in any thread that wishes to access the display
     92 * or its child objects (e.g. windows).
     93 *
     94 * @param disp Display
     95 */
     96void ds_display_lock(ds_display_t *disp)
     97{
     98        fibril_mutex_lock(&disp->lock);
     99}
     100
     101/** Unlock display.
     102 *
     103 * @param disp Display
     104 */
     105void ds_display_unlock(ds_display_t *disp)
     106{
     107        fibril_mutex_unlock(&disp->lock);
    86108}
    87109
Note: See TracChangeset for help on using the changeset viewer.