forked from enlightenment/efl
Carsten Haitzler
3df71ab0f6
Imagine this. You have an object. You pass this object handle as a message to another thread. Let's say it's not a UI object, so something you might expect to be able to be accessed from multiple threads. In order to keep the object alive you eo_ref() it when placing the message on a queue and eo_unref() it once the message is "done" in the other thread. If the original sender unref()ed the object before the message is done, then the object will be destroyed in the reciever thread. This is bad for objects "expecting" not to be destroyed outside their owning thread. This allows thius situation to be fixed. A constructor in a class of an object can set up a delete interceptor. For example if we have a "loop ownership" class you multi-ple-inherit from/use as a mixin. This class will set up the interceptor to ensure that on destruction if pthread_self() != owning loop thread id, then add object to "delete me" queue on the owning loop and wake it up. the owning loop thread will wake up and then process this queue and delete the queued objects nicely and safely within the "owning context". This can also be used in this same manner to defer deletion within a loop "until later" in the same delete_me queue. You can even use this as a caching mechanism for objects to prevernt their actual destruction and instead place them in a cached area to be picked from at a later date. The uses are many for this and this is a basic building block for future EFL features like generic messages where a message payload could be an eo object and thus the above loop onwership issue can happen and needs fixing. This adds APIs, implementation, documentation (doxy reference) and tests. @feature |
||
---|---|---|
.. | ||
ecore | ||
ecore_audio | ||
ecore_avahi | ||
ecore_buffer | ||
ecore_cocoa | ||
ecore_con | ||
ecore_drm | ||
ecore_evas | ||
ecore_fb | ||
ecore_file | ||
ecore_imf | ||
ecore_imf_evas | ||
ecore_input | ||
ecore_input_evas | ||
ecore_ipc | ||
ecore_psl1ght | ||
ecore_sdl | ||
ecore_wayland | ||
ecore_win32 | ||
ecore_wl2 | ||
ecore_x | ||
ector | ||
edje | ||
eet | ||
eeze | ||
efl | ||
efreet | ||
eina | ||
eio | ||
eldbus | ||
elocation | ||
elua | ||
embryo | ||
emile | ||
emotion | ||
eo | ||
eolian | ||
eolian_cxx | ||
ephysics | ||
escape | ||
ethumb | ||
ethumb_client | ||
evas | ||
evil | ||
.gitignore |