Commit Graph

20 Commits

Author SHA1 Message Date
Guilherme Lepsch 7a302f12d9 eina: Fix MacOS X build with clang 3.6.
Summary:
printf contains and erroneous format specifier and cast
missing LIBTOOLFLAGS for cocoa

Reviewers: felipealmeida, larryolj, naguirre

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1912

Signed-off-by: Nicolas Aguirre <aguirre.nicolas@gmail.com>
2015-02-12 07:55:33 +01:00
pierre lamot 6fd31ab552 eina: fix semaphore initialisation
This patch fix the semaphore initialisation on posix plateform

there was a preconditon test which returned the semaphore
uninitialised when count_init was 1, this caused the semaphore to
be unusable on OSX plateform. Furthermore, it seems that we need to
unlink the semaphore before its initialisation on OSX as there seems
to have some kind of persistence of the semaphore accross execution.

warning, this patch change the signification of the parametter
count_init on linux plateform, this parametter is now consistent on
every plateform, with the meaning of setting the initial count value
of the semaphore.

This used to be on linux 1 -> the semaphore is shared and initialised
at 1 and 0 -> the semaphore is not initialised, thus, by side effect
not shared and initialised at 0.

This patch set on linux plateform the semaphore as systematically
shared

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-05 16:38:06 +01:00
Jean-Philippe ANDRE d0bae13693 Eina lock: try to fix compilation for OSX
This is a quick fix.

It looks like OSX doesn't provide the same infra as linux for
cond_timedwait, but instead they provide directly a
relative time wait function. Since I don't have any build / test
environment for OSX, this is as far as I can go.

Arguably, OSX libc seems to use gettimeofday() for cond_timedwait,
so this should close T1701.

See the pthread cond implementation:
http://www.opensource.apple.com/source/Libc/Libc-167/pthreads.subproj/pthread_cond.c
2014-11-02 15:14:36 +09:00
Jean-Philippe Andre 864394e793 Eina: Fix eina_condition_timedwait once again
Much confusion with this spaghetti code of #ifdefs and clocks.
So, we can't use CPU clocks for the timedwait, this doesn't make
sense (and it's explicit in the manpage, too).

But we can use CLOCK_MONOTONIC or CLOCK_MONOTONIC_RAW which are
much better than the wall clock (because of ntp updates, etc...)

The test case tests that the cond actually waited for as long as was
requested and for not too long either.

This is hopefully a final fix for T1701.
2014-10-30 20:21:41 +09:00
Stefan Schmidt 0619c757ba eina: Fix _timedwait to handle the given timeout on top of the absolute time
The pthread man page clearly states that pthread_cond_timedwait() takes an
absolute time parameter. So far we always passed it epoch plus timeout in
seconds. This would never trigger the timeout.

Making sure we fill out timespec struct with the current time before adding
the timeout as offset now. Also handling the t < 0 error case.

Various version worked up together with Jean-Philippe Andre <jp.andre@samsung.com>

This version does not use _eina_time_get directly as this is currently not a
public API of eina. If we decide to make _eina_time_get public we can remove the
extra code here.

Fixes T1701
2014-10-29 15:35:30 +01:00
Jean Guyomarc'h 6de8e3104d eina_semaphore: OSX support
Summary:
OSX only support named semaphores. Eina_Semaphore was actually broken on OSX.
Since OSX 10.10 sem_init() and sem_destroy() (were not implemented) are also marked as
"deprecated", which adds huge pollution to the output when compiling.

Reviewers: cedric, raster, stefan_schmidt

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1576

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2014-10-27 09:11:23 +01:00
Stefan Schmidt 4091b4824d Revert "eina: Fix _timedwait to handle the given timeout on top of the absolute time"
Not ready yet as it uses _eina_time_get which is internal only right now. Compiling
works fine for efl alone as the private header is in teh include search part but it
blows up when compiling elementary.

Need to think a bit more about this. Maybe exposing _eina_time_get as API but that
should wait until after the release.

This reverts commit f0a02a92be.
2014-10-23 15:12:55 +02:00
Stefan Schmidt f0a02a92be eina: Fix _timedwait to handle the given timeout on top of the absolute time
The pthread man page clearly states that pthread_cond_timedwait() takes an
absolute time parameter. So far we always passed it epoch plus timeout in
seconds. This would never trigger the timeout.

Making sure we fill out timespec struct with the current time before adding
the timeout as offset now. Also handling the t < 0 error case.

Various version worked up together with Jean-Philippe Andre <jp.andre@samsung.com>

Fixes T1701
2014-10-23 11:01:35 +02:00
Jean Guyomarc'h f449f0ddb6 eina: port Eina_Spinlock for OSX
Summary: Support of Spinlocks in Eina (Eina_Spinlock) for OSX, which does not implement them in pthread.
@feature

Reviewers: raster, raoulh, naguirre, cedric, stefan_schmidt

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1151

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2014-08-21 12:04:53 +02:00
Jeff Grimshaw 74556a3f90 efl/eina: Update documentatin for Eina Lock
Summary: Updated documentation for Eina Lock and related files.

Test Plan: Reviewers

Reviewers: cedric, raster

CC: cedric, raster

Differential Revision: https://phab.enlightenment.org/D650
2014-03-25 17:30:43 +09:00
Jérémy Zurcher 316dc52d2f eina_tls: add eina_tls_cb_new(Eina_TLS *key, Eina_TLS_Delete_Cb delete_cb)
Summary:
   delete_cb is called at thread exit for each Eina_TLS keys used by the thread

Details:
   posix:
      pthread_key_create(key, delete_cb); does it
   win32/wince:
      eina_tls_free/new un/registers key&&cb into a static eina_list.
      eina_tls_set add the key to an eina_list in Eina_Thread_Win3.
      this list is cleared and callbacks are called in _eina_thread_join()

Test Plan: win32/wince has to be tested, I have no setup to do it.

Reviewers: cedric

CC: cedric

Differential Revision: https://phab.enlightenment.org/D489
2014-01-23 14:50:08 +09:00
Carsten Haitzler 3a1d560c0c eina lock posix - remove dead code in eina_spinlock_take
this solves CID 1106340
2014-01-10 16:58:39 +09:00
Cedric Bail 319766f837 eina: fix support for system requiring _XOPEN_SOURCE to use spinlock and barrier. 2014-01-04 11:25:19 +09:00
Carsten Haitzler f93329d119 Revert "eina: fix CID 1106340: Logically dead code (DEADCODE) reported by coverity."
This reverts commit 1c1b48ca64.

this commit is causing all sorts of hell and crashes, hangs and what
not. like:

Thread 1 (Thread 0x7feb7389e780 (LWP 7149)):
No symbol table info available.
No symbol table info available.
    at lib/eina/eina_inlist.c:422
            l = 0xf38a50
                    __FUNCTION__ = "eina_inlist_demote"
                    #3  0x00007feb6a809867 in
_eina_chained_mempool_alloc_in (
    pool=pool@entry=0x8650a0, p=p@entry=0xf38a50)
        at modules/eina/mp/chained_pool/eina_chained_mempool.c:197
                mem = 0xf3a690
                #4  0x00007feb6a809dff in eina_chained_mempool_malloc
(data=0x8650a0,
    size=<optimized out>)
        at modules/eina/mp/chained_pool/eina_chained_mempool.c:300
                pool = 0x8650a0
                        p = 0xf38a50
                                mem = <optimized out>
                                #5  0x00007feb6a7e451f in
eina_mempool_malloc (size=40, mp=<optimized out>)
    at lib/eina/eina_inline_mempool.x:103
    No locals.
    #6  _eina_list_mempool_list_new (list=0x7feb5402a510)
        at lib/eina/eina_list.c:199
        No locals.
        #7  eina_list_append (list=0x7feb5402a510, data=0xf41720)
            at lib/eina/eina_list.c:534
                    l = <optimized out>
                            __FUNCTION__ = "eina_list_append"
                            #8  0x0000000000445d1a in
e_bindings_signal_add (ctxt=<optimized out>,
    sig=0x947e6c "mouse,clicked,[12]", src=0x92248c "e.event.close",
        mod=E_BINDING_MODIFIER_NONE, any_mod=1, action=0x93479c
"window_close",
    params=0x0) at e_bindings.c:1036
            binding = 0xf41720
            #9  0x00000000004469d4 in e_bindings_init () at
e_bindings.c:68
        ebs = 0x947df0
                ebm = <optimized out>
                        ebw = <optimized out>
                                ebe = <optimized out>
                                        ebk = <optimized out>
                                                eba = <optimized out>
                                                        l = 0x9532e0
                                                        #10
0x0000000000437516 in main (argc=<optimized out>, argv=<optimized out>)
    at e_main.c:941
            safe_mode = 0 '\000'
                    after_restart = 1 '\001'
                            waslocked = 0 '\000'
                                    t = <optimized out>
                                            tstart = <optimized out>
                                                    s = <optimized out>
                                                            buff =
"1381800872.3", '\000' <repeats 19 times>
        action = {__sigaction_handler = {
                    sa_handler = 0x4fca00 <e_sigabrt_act>,
                                sa_sigaction = 0x4fca00
<e_sigabrt_act>}, sa_mask = {__val = {
              0 <repeats 16 times>}}, sa_flags = -1073741820,
                        sa_restorer = 0x0}
                                __FUNCTION__ = "main"
                                Detaching from program:
/usr/local/bin/enlightenment, process 7149
2013-10-15 10:42:26 +09:00
Cedric BAIL 1c1b48ca64 eina: fix CID 1106340: Logically dead code (DEADCODE) reported by coverity. 2013-10-14 13:32:46 +02:00
Cedric Bail 68a4e85483 eina: that stuff was just for adding a bug in fact. 2013-10-11 17:30:35 +09:00
Cedric Bail 1b07350a46 eina: add Eina_Spinlock API. 2013-10-11 11:08:17 +09:00
Carsten Haitzler 42a59387a6 add eina barrier to efl tree.
SVN revision: 78100
2012-10-17 03:55:35 +00:00
Vincent Torri 1c96844922 Eina: backport rev. 77445
SVN revision: 77446
2012-10-04 17:16:18 +00:00
Carsten Haitzler 0a5ba96837 move eina headers into lib/eina like the rest of efl - at least be
consistent with the majority.



SVN revision: 77119
2012-09-27 04:02:37 +00:00