Commit Graph

20 Commits

Author SHA1 Message Date
Stefan Schmidt 695b44526c eina: remove no longer used function _eina_thread_queue_msg_block_real_free
Summary:
It seems this function is no longer used since some rework. Clean it up.
lib/eina/eina_thread_queue.c:127:1: warning: ‘_eina_thread_queue_msg_block_real_free’ defined but not used [-Wunused-function]

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6537
2018-07-09 10:22:59 -04:00
Mike Blumenkrantz b0cb3b935a eina/threadqueue: use mempool_del for hash free function
Summary:
I typod this in 14ae3e3dec and when using
mempools other than chained, this probably caused all apps to crash on
shutdown

Reviewers: ManMower, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6428
2018-06-25 17:55:25 -04:00
Mike Blumenkrantz 14ae3e3dec eina_thread_queue: use normal mempools for block allocation
there's no need to reimplement mempools here when we already have a great
mempool api

this makes the code slightly more readable

Differential Revision: https://phab.enlightenment.org/D6353
2018-06-25 15:14:30 -04:00
Mike Blumenkrantz 6353a699e3 eina_threadqueue: add locking for variable used between threads
Summary:
the 'first' member of this struct is used simultaneously across
threads and can have conflicting read/write operations occurring at this
time

as int operations are not guaranteed to be atomic, ensure that we are
using atomic operations or locking as necessary

@fix

Depends on D6299

Reviewers: ManMower, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6300
2018-06-19 13:30:44 -04:00
Mike Blumenkrantz a446fb86fc eina_threadqueue: simplify/unify some locking code
Summary:
this moves lock calls outside #ifdef blocks to make the code more
readable

no functional changes
Depends on D6298

Reviewers: ManMower, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6299
2018-06-19 13:30:36 -04:00
Mike Blumenkrantz df2f614431 eina_threadqueue: fix spinlock destruction by using spinlock api
Summary:
this would deadlock in some cases

@fix
Depends on D6297

Reviewers: ManMower, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6298
2018-06-19 13:30:26 -04:00
Stefan Schmidt d126107782 Revert "eina threadqueue - for paranoia lock+ulock+free in order locks taken"
This reverts commit d19cd4e63c.

This causes a SIGBUS error on OpenBSD when closing any application. As this
was safety patch only I will revert it for the 1.18 release and we can work
out what breaks OpenBSD here for 1.19

Fixes T4332
2016-08-11 15:25:32 +02:00
Carsten Haitzler d19cd4e63c eina threadqueue - for paranoia lock+ulock+free in order locks taken
so mimic order of locks taken to be paranoid ... this wouldnt be a
deadlock issue but just to be safe instead of sorry.
2016-08-06 09:56:02 +09:00
Carsten Haitzler 26db5d5056 eina thread queue - ensure blocks cannot be freed until lock+unlock
just in case... check blocks cannot be freed until locked and unlocked
just in case someone still is holding a lock.
2016-08-05 23:52:20 +09:00
Carsten Haitzler 8fd224b4d6 eina thread queue/semaphores - check even more unlikely errors + complain
check some really unlikely alloc errors and semaphore deadlock errors
and report if that has happened. just in case.
2016-08-05 17:38:02 +09:00
Carsten Haitzler 07924f26f1 eina thread queue - check returns fo semaphore new/lock/release to debug
so openbsd may have issues with semaphores - maybe. this would catch
them if it it. why - if sem_init/sem_wait are different... i dont know.
2016-08-05 17:09:34 +09:00
Carsten Haitzler 6b6823e5af eina_threadqueue - fix const ptr warning on spinlocks if atomic disabled
atomics SHOULDNT be disabled anyway, but if they are... fix this
warning. (no real bug)
2016-08-05 13:42:50 +09:00
Carsten Haitzler 7920e66f29 efl - fix threadqueue spinlock destruction on openbsd - doesn't like it
so the spinlock on the threadqueue block pool it taken on shutdownn,
while the block pool is freed up then its is destroyed, but openbsd
very much doesnt like this and returns an error, so release the lock
before destroying it.

@fix
2016-03-02 10:33:40 +09:00
Stefan Schmidt 038c4fed6c eina_thread_queue: use Eina_Bool for one-bit bitfield
Make sure we are using a unsigned var here. Best go with a Eina_Bool directly.
2015-11-13 13:31:34 +01:00
Jean-Philippe Andre e2022f4157 eina: Add NULL check for eina_threadqueue_free
@fix
2015-04-10 11:34:50 +09:00
Carsten Haitzler 479c0f37a4 fix efl deadlock with thread queues
@fix
2014-08-24 22:19:05 +09:00
Carsten Haitzler f93fb3c7f6 eina thread queue - check write return
this addresses CID 1226191. this should never have an error as the fd
should always be valid as long as needed.
2014-08-13 19:06:40 +09:00
Carsten Haitzler c012e6939c eina thread queue - fix possible deadlock
coverity pointed out a deadlock - CID 1226193. i hope this fixes it
(need to wait days for a coverity re-run). tests pass and real life
usage works, so i assume its ok. in theory i see no problem either.
2014-08-13 17:36:00 +09:00
Carsten Haitzler 45f01bd11c eina - thread queue - fix block pool shutdown 2014-07-16 20:43:32 +09:00
Carsten Haitzler 3c130836ad new eina api/object - eina thread queues
@feature

This is a new feature for eina (and EFL) - a zero-copy thread message
queue for sending messages from one thread to another or from the
ecore mainloop to or back to the mainloop from threads. It has a
complete test suite too.
2014-07-15 20:39:13 +09:00