efl

Форк
0
/
eina_cxx_thread_01.cc 
50 строк · 1.1 Кб
1
/*
2
 * Copyright 2019 by its authors. See AUTHORS.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
//Compile with:
17
//gcc -g eina_list_01.c -o eina_list_01 `pkg-config --cflags --libs eina`
18

19
#ifdef HAVE_CONFIG_H
20
# include <config.h>
21
#endif
22

23
#include <stdio.h>
24
#include <Eina.hh>
25

26
#include <iterator>
27
#include <algorithm>
28

29
#include <iostream>
30

31
namespace eina = efl::eina;
32

33
void thread1(eina::mutex&)
34
{
35
}
36

37
int main()
38
{
39
   eina::eina_init eina_init;
40
   eina::eina_threads_init threads_init;
41

42
   eina::mutex m;
43
   eina::condition_variable c;
44

45
   eina::unique_lock<eina::mutex> l(m);
46

47
   eina::thread thread1(&::thread1, eina::ref(m));
48

49
   thread1.join();
50
}
51

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.