summaryrefslogtreecommitdiff
path: root/src/lib/ecore/efl_threadio.eo
blob: 80b4f5b6537103cfce0e46a01e2b20588e3fddba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function @beta EflThreadIOCall {
   [[A Function to be called asynchronously on a different thread.]]
   params {
      @in event: const(event); [[Event struct with an @Efl.Loop_Handler as payload.]]
   }
};

function @beta EflThreadIOCallSync {
   [[A Function to be called synchronously on another thread.
     Execution will be stopped until this function returns and its return value can be recovered.
   ]]
   params {
      @in event: const(event); [[Event struct with an @Efl.Loop_Handler as payload.]]
   }
   return: void_ptr; [[Data that the function executed on the other thread returned.]]
};

mixin @beta Efl.ThreadIO
{
   [[This mixin defines input and output pointers to allow exchanging data with another thread.
     It also defines a mechanism to call methods on that thread.
   ]]
   methods {
      @property indata {
         [[Input data pointer for the thread.]]
         set { }
         get { }
         values {
            data: void_ptr; [[Data pointer.]]
         }
      }
      @property outdata {
         [[Output data pointer for the thread.]]
         set { }
         get { }
         values {
            data: void_ptr; [[Data pointer.]]
         }
      }
      call @pure_virtual {
         [[Executes a method on a different thread, asynchronously.]]
         params {
            func: EflThreadIOCall; [[The method to execute asynchronously.]]
         }
      }
      call_sync @pure_virtual {
         [[Executes a method on a different thread, synchronously.
           This call will not return until the method finishes and its return value can be recovered.
         ]]
         params {
            func: EflThreadIOCallSync; [[The method to execute synchronously.]]
         }
         return: void_ptr; [[The return value from the method.]]
      }
   }
   events {
   }
   implements {
   }
}