[MEM] Add .reset_buffer() to prevent deadlocks on various error cases
authorDongju Chae <dongju.chae@samsung.com>
Fri, 8 Nov 2019 07:41:29 +0000 (16:41 +0900)
committer송욱/On-Device Lab(SR)/Staff Engineer/삼성전자 <wook16.song@samsung.com>
Mon, 11 Nov 2019 02:23:20 +0000 (11:23 +0900)
commit04c84af439ed22f4b10655f274bd932c61129433
treebd43021268cb33b48813bda4d2cf5a09cbff4990
parent03d018934cbb5bcd93f7eb189cf9a4614c48ab3e
[MEM] Add .reset_buffer() to prevent deadlocks on various error cases

This commit adds new API, .reset_buffer(), to prevent deadlocks on various error cases.

When some errors occurs, ne-host-inputservice.c and ne-inf.c used to emulate normal execution by explicitly calling return_buffer().
However, as output callback can be not called, deadlock situations often happen when the exact transition of buffer states is not performed.

So, this patch makes the buffer state to initial one on all error cases to reduce the complexity and prevent deadlocks.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
src/core/ne-host-input-service.c
src/core/ne-inf.c
src/core/ne-inputservice.h
src/core/ne-mem.c
src/core/ne-mem.h