fix race condition in serviceRegistry_getService. 346/head
authorPengZheng <howtofly@gmail.com>
Sun, 30 May 2021 13:09:41 +0000 (21:09 +0800)
committerPengZheng <howtofly@gmail.com>
Sun, 30 May 2021 13:09:41 +0000 (21:09 +0800)
commit4fb7d952cc2c386320e6524a16bd577e9e7f35f0
treeeaa751ab148ff4940e4e8fc44a2b4b57630408ce
parent0cd23ad37ccb238f82a002321de4e396f08b2f85
fix race condition in serviceRegistry_getService.

Before serviceReference_setService is called for the first
reference usage, there is a window in which the subsequent reference
usages get NULL service. Moreover, serviceRegistration_retain
and serviceRegistration_release are not called in pairs for invalid
registration, which may cause assertion failure.
libs/framework/src/service_registry.c