diff --git a/.travis.yml b/.travis.yml index bcf3c95..1a2db19 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2014-2015, Siemens AG. All rights reserved. +# Copyright (c) 2014-2016, Siemens AG. All rights reserved. # SPDX-License-Identifier: BSD-2-Clause language: cpp diff --git a/CMakeCommon/CheckEnableTests.cmake b/CMakeCommon/CheckEnableTests.cmake index 7a28984..1a58ee2 100644 --- a/CMakeCommon/CheckEnableTests.cmake +++ b/CMakeCommon/CheckEnableTests.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2014-2015, Siemens AG. All rights reserved. +# Copyright (c) 2014-2016, Siemens AG. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/CMakeCommon/CopyInstallFiles.cmake b/CMakeCommon/CopyInstallFiles.cmake index 321b62e..1ecf6b7 100644 --- a/CMakeCommon/CopyInstallFiles.cmake +++ b/CMakeCommon/CopyInstallFiles.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2014-2015, Siemens AG. All rights reserved. +# Copyright (c) 2014-2016, Siemens AG. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/CMakeCommon/CreateDoxygenDocumentationTarget.cmake b/CMakeCommon/CreateDoxygenDocumentationTarget.cmake index b8c2bbc..547a9b8 100644 --- a/CMakeCommon/CreateDoxygenDocumentationTarget.cmake +++ b/CMakeCommon/CreateDoxygenDocumentationTarget.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2014-2015, Siemens AG. All rights reserved. +# Copyright (c) 2014-2016, Siemens AG. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/CMakeCommon/GroupSourcesMSVC.cmake b/CMakeCommon/GroupSourcesMSVC.cmake index e74470b..b16748b 100644 --- a/CMakeCommon/GroupSourcesMSVC.cmake +++ b/CMakeCommon/GroupSourcesMSVC.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2014-2015, Siemens AG. All rights reserved. +# Copyright (c) 2014-2016, Siemens AG. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/CMakeCommon/SetCompilerFlags.cmake b/CMakeCommon/SetCompilerFlags.cmake index dc07374..9e18728 100644 --- a/CMakeCommon/SetCompilerFlags.cmake +++ b/CMakeCommon/SetCompilerFlags.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2014-2015, Siemens AG. All rights reserved. +# Copyright (c) 2014-2016, Siemens AG. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -90,10 +90,19 @@ function(SetVisualStudioCompilerFlags) # Locally suppressed warnings (should not be globally suppressed): # 4640 -> Information that local static variable initialization is not # thread-safe. + # + # VS 2015 specific warnings: + # 5026 -> Move constructor was implicitly defined as deleted + # 5027 -> Move assignment operator was implicitly defined as deleted + # set(warning_flags "/Wall /wd4820 /wd4514 /wd4668 /wd4710 /wd4350 /wd4571 /wd4625 /wd4626 /wd4711 /wd4255") - if (WARNINGS_ARE_ERRORS STREQUAL ON) + if (WARNINGS_ARE_ERRORS STREQUAL ON) set(warning_flags "${warning_flags} /WX") - endif() + endif() + string(FIND "${CMAKE_GENERATOR}" "Visual Studio 14 2015" vs2015_state) + if (vs2015_state EQUAL 0) + set(warning_flags "${warning_flags} /wd5026 /wd5027") + endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${warning_flags}" PARENT_SCOPE) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${warning_flags}" PARENT_SCOPE) endif() diff --git a/CMakeCommon/SetInstallPaths.cmake b/CMakeCommon/SetInstallPaths.cmake index ae498bb..bd98c78 100644 --- a/CMakeCommon/SetInstallPaths.cmake +++ b/CMakeCommon/SetInstallPaths.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2014-2015, Siemens AG. All rights reserved. +# Copyright (c) 2014-2016, Siemens AG. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/CMakeLists.txt b/CMakeLists.txt index c2c316b..048cb09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2014-2015, Siemens AG. All rights reserved. +# Copyright (c) 2014-2016, Siemens AG. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -53,12 +53,6 @@ if(POLICY CMP0053) cmake_policy(SET CMP0053 OLD) endif(POLICY CMP0053) - -include(CMakeCommon/FindOpenCL.cmake) -IF(NOT OpenCL_FOUND) - MESSAGE( STATUS "OpenCL is not there, will build without MTAPI OpenCL Plugin." ) -ENDIF() - # give the user the possibility, to append compiler flags set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CMAKE_CXX_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CMAKE_C_FLAGS}") @@ -88,6 +82,7 @@ option(USE_EXCEPTIONS "Specify whether exceptions should be activated in C++" ON option(INSTALL_DOCS "Specify whether Doxygen docs should be installed" ON) option(WARNINGS_ARE_ERRORS "Specify whether warnings should be treated as errors" OFF) option(USE_AUTOMATIC_INITIALIZATION "Specify whether the MTAPI C++ interface, algorithms and dataflow should automatically intialize the MTAPI node if no explicit initialization is present" ON) +option(BUILD_OPENCL_PLUGIN "Specify whether the MTAPI OpenCL plugin should be built" OFF) ## LOCAL INSTALLATION OF SUBPROJECT BINARIES # @@ -146,7 +141,7 @@ set(EXPECTED_EMBB_TEST_EXECUTABLES "embb_algorithms_cpp_test" ) # if opencl is there, we also expect the mtapi opencl test to be generated -if(OpenCL_FOUND) +if(BUILD_OPENCL_PLUGIN STREQUAL ON) list(APPEND EXPECTED_EMBB_TEST_EXECUTABLES "embb_mtapi_opencl_c_test") endif() @@ -181,9 +176,9 @@ CheckPartestInstall(${BUILD_TESTS} partest_includepath partest_libpath) add_subdirectory(base_c) add_subdirectory(base_cpp) add_subdirectory(mtapi_c) -add_subdirectory(mtapi_network_c) -if(OpenCL_FOUND) - add_subdirectory(mtapi_opencl_c) +add_subdirectory(mtapi_plugins_c/mtapi_network_c) +if(BUILD_OPENCL_PLUGIN STREQUAL ON) + add_subdirectory(mtapi_plugins_c/mtapi_opencl_c) endif() add_subdirectory(tasks_cpp) add_subdirectory(mtapi_cpp) diff --git a/COPYING.md b/COPYING.md index b3afc05..3459f6f 100644 --- a/COPYING.md +++ b/COPYING.md @@ -13,7 +13,7 @@ license (see file include\embb\mtapi\c\mtapi.h). License ------- -Copyright (c) 2014-2015, Siemens AG. All rights reserved. +Copyright (c) 2014-2016, Siemens AG. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index 58efb20..f829b34 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,8 @@ postfixed with either "_cpp" or "_c" for the C++ and C versions, respectively. Currently, EMBĀ² contains the following components: - base: base_c, base_cpp - - mtapi: mtapi_c, mtapi_network_c, mtapi_opencl_c, mtapi_cpp + - mtapi: mtapi_c, mtapi_cpp and + mtapi_plugins_c (mtapi_network_c and mtapi_opencl_c) - tasks: tasks_cpp - algorithms: algorithms_cpp - dataflow: dataflow_cpp diff --git a/algorithms_cpp/include/embb/algorithms/algorithms.h b/algorithms_cpp/include/embb/algorithms/algorithms.h index a4df292..bac8709 100644 --- a/algorithms_cpp/include/embb/algorithms/algorithms.h +++ b/algorithms_cpp/include/embb/algorithms/algorithms.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/include/embb/algorithms/count.h b/algorithms_cpp/include/embb/algorithms/count.h index 73f5b31..6016687 100644 --- a/algorithms_cpp/include/embb/algorithms/count.h +++ b/algorithms_cpp/include/embb/algorithms/count.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/include/embb/algorithms/for_each.h b/algorithms_cpp/include/embb/algorithms/for_each.h index 23af854..54e57a0 100644 --- a/algorithms_cpp/include/embb/algorithms/for_each.h +++ b/algorithms_cpp/include/embb/algorithms/for_each.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/include/embb/algorithms/identity.h b/algorithms_cpp/include/embb/algorithms/identity.h index 26235ce..d2ae305 100644 --- a/algorithms_cpp/include/embb/algorithms/identity.h +++ b/algorithms_cpp/include/embb/algorithms/identity.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/include/embb/algorithms/internal/count-inl.h b/algorithms_cpp/include/embb/algorithms/internal/count-inl.h index 140fe51..dd11e38 100644 --- a/algorithms_cpp/include/embb/algorithms/internal/count-inl.h +++ b/algorithms_cpp/include/embb/algorithms/internal/count-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/include/embb/algorithms/internal/for_each-inl.h b/algorithms_cpp/include/embb/algorithms/internal/for_each-inl.h index fb5dcd3..8a4457a 100644 --- a/algorithms_cpp/include/embb/algorithms/internal/for_each-inl.h +++ b/algorithms_cpp/include/embb/algorithms/internal/for_each-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/include/embb/algorithms/internal/merge_sort-inl.h b/algorithms_cpp/include/embb/algorithms/internal/merge_sort-inl.h index 7cd2448..f278811 100644 --- a/algorithms_cpp/include/embb/algorithms/internal/merge_sort-inl.h +++ b/algorithms_cpp/include/embb/algorithms/internal/merge_sort-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/include/embb/algorithms/internal/partition-inl.h b/algorithms_cpp/include/embb/algorithms/internal/partition-inl.h index 231ccb4..f1c2bca 100644 --- a/algorithms_cpp/include/embb/algorithms/internal/partition-inl.h +++ b/algorithms_cpp/include/embb/algorithms/internal/partition-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/include/embb/algorithms/internal/partition.h b/algorithms_cpp/include/embb/algorithms/internal/partition.h index 400923d..948eb28 100644 --- a/algorithms_cpp/include/embb/algorithms/internal/partition.h +++ b/algorithms_cpp/include/embb/algorithms/internal/partition.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/include/embb/algorithms/internal/quick_sort-inl.h b/algorithms_cpp/include/embb/algorithms/internal/quick_sort-inl.h index 79a1241..e87927e 100644 --- a/algorithms_cpp/include/embb/algorithms/internal/quick_sort-inl.h +++ b/algorithms_cpp/include/embb/algorithms/internal/quick_sort-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/include/embb/algorithms/internal/reduce-inl.h b/algorithms_cpp/include/embb/algorithms/internal/reduce-inl.h index bc15801..28c35ab 100644 --- a/algorithms_cpp/include/embb/algorithms/internal/reduce-inl.h +++ b/algorithms_cpp/include/embb/algorithms/internal/reduce-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/include/embb/algorithms/internal/scan-inl.h b/algorithms_cpp/include/embb/algorithms/internal/scan-inl.h index cbf748e..b81022e 100644 --- a/algorithms_cpp/include/embb/algorithms/internal/scan-inl.h +++ b/algorithms_cpp/include/embb/algorithms/internal/scan-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/include/embb/algorithms/invoke.h b/algorithms_cpp/include/embb/algorithms/invoke.h index a3884a4..ced924f 100644 --- a/algorithms_cpp/include/embb/algorithms/invoke.h +++ b/algorithms_cpp/include/embb/algorithms/invoke.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/include/embb/algorithms/merge_sort.h b/algorithms_cpp/include/embb/algorithms/merge_sort.h index 6e94903..a09cc90 100644 --- a/algorithms_cpp/include/embb/algorithms/merge_sort.h +++ b/algorithms_cpp/include/embb/algorithms/merge_sort.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/include/embb/algorithms/quick_sort.h b/algorithms_cpp/include/embb/algorithms/quick_sort.h index 80181d5..adefe09 100644 --- a/algorithms_cpp/include/embb/algorithms/quick_sort.h +++ b/algorithms_cpp/include/embb/algorithms/quick_sort.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/include/embb/algorithms/reduce.h b/algorithms_cpp/include/embb/algorithms/reduce.h index 463e1b8..1cf5d86 100644 --- a/algorithms_cpp/include/embb/algorithms/reduce.h +++ b/algorithms_cpp/include/embb/algorithms/reduce.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/include/embb/algorithms/scan.h b/algorithms_cpp/include/embb/algorithms/scan.h index 8a32e91..11d1315 100644 --- a/algorithms_cpp/include/embb/algorithms/scan.h +++ b/algorithms_cpp/include/embb/algorithms/scan.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/include/embb/algorithms/zip_iterator.h b/algorithms_cpp/include/embb/algorithms/zip_iterator.h index a3e033d..0de6ebf 100644 --- a/algorithms_cpp/include/embb/algorithms/zip_iterator.h +++ b/algorithms_cpp/include/embb/algorithms/zip_iterator.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/src/dummy.cc b/algorithms_cpp/src/dummy.cc index 13566b9..f2ce3d4 100644 --- a/algorithms_cpp/src/dummy.cc +++ b/algorithms_cpp/src/dummy.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/count_test.cc b/algorithms_cpp/test/count_test.cc index 0ab2571..6678383 100644 --- a/algorithms_cpp/test/count_test.cc +++ b/algorithms_cpp/test/count_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/count_test.h b/algorithms_cpp/test/count_test.h index 95f2a32..55862c7 100644 --- a/algorithms_cpp/test/count_test.h +++ b/algorithms_cpp/test/count_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/for_each_test.cc b/algorithms_cpp/test/for_each_test.cc index df46122..b42179e 100644 --- a/algorithms_cpp/test/for_each_test.cc +++ b/algorithms_cpp/test/for_each_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/for_each_test.h b/algorithms_cpp/test/for_each_test.h index f768662..efe7875 100644 --- a/algorithms_cpp/test/for_each_test.h +++ b/algorithms_cpp/test/for_each_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/invoke_test.cc b/algorithms_cpp/test/invoke_test.cc index 1481747..2776ed3 100644 --- a/algorithms_cpp/test/invoke_test.cc +++ b/algorithms_cpp/test/invoke_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/invoke_test.h b/algorithms_cpp/test/invoke_test.h index e75ecc3..4679b26 100644 --- a/algorithms_cpp/test/invoke_test.h +++ b/algorithms_cpp/test/invoke_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/main.cc b/algorithms_cpp/test/main.cc index 1da1475..5ae28d5 100644 --- a/algorithms_cpp/test/main.cc +++ b/algorithms_cpp/test/main.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/merge_sort_test.cc b/algorithms_cpp/test/merge_sort_test.cc index c3fd3ee..43c9dc1 100644 --- a/algorithms_cpp/test/merge_sort_test.cc +++ b/algorithms_cpp/test/merge_sort_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/merge_sort_test.h b/algorithms_cpp/test/merge_sort_test.h index 7dbc8b0..45bc4dc 100644 --- a/algorithms_cpp/test/merge_sort_test.h +++ b/algorithms_cpp/test/merge_sort_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/partitioner_test.cc b/algorithms_cpp/test/partitioner_test.cc index d17cc77..2ce02c9 100644 --- a/algorithms_cpp/test/partitioner_test.cc +++ b/algorithms_cpp/test/partitioner_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/partitioner_test.h b/algorithms_cpp/test/partitioner_test.h index ecea402..31001bb 100644 --- a/algorithms_cpp/test/partitioner_test.h +++ b/algorithms_cpp/test/partitioner_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/quick_sort_test.cc b/algorithms_cpp/test/quick_sort_test.cc index 151b658..ef1faba 100644 --- a/algorithms_cpp/test/quick_sort_test.cc +++ b/algorithms_cpp/test/quick_sort_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/quick_sort_test.h b/algorithms_cpp/test/quick_sort_test.h index 1d2ef03..1523117 100644 --- a/algorithms_cpp/test/quick_sort_test.h +++ b/algorithms_cpp/test/quick_sort_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/reduce_test.cc b/algorithms_cpp/test/reduce_test.cc index 63d31be..cf66a0a 100644 --- a/algorithms_cpp/test/reduce_test.cc +++ b/algorithms_cpp/test/reduce_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/reduce_test.h b/algorithms_cpp/test/reduce_test.h index 50ab6ca..e2d8e13 100644 --- a/algorithms_cpp/test/reduce_test.h +++ b/algorithms_cpp/test/reduce_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/scan_test.cc b/algorithms_cpp/test/scan_test.cc index 61f85f5..ffab634 100644 --- a/algorithms_cpp/test/scan_test.cc +++ b/algorithms_cpp/test/scan_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/scan_test.h b/algorithms_cpp/test/scan_test.h index 553f8bc..44e66b5 100644 --- a/algorithms_cpp/test/scan_test.h +++ b/algorithms_cpp/test/scan_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/zip_iterator_test.cc b/algorithms_cpp/test/zip_iterator_test.cc index d345206..2e67e7c 100644 --- a/algorithms_cpp/test/zip_iterator_test.cc +++ b/algorithms_cpp/test/zip_iterator_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/algorithms_cpp/test/zip_iterator_test.h b/algorithms_cpp/test/zip_iterator_test.h index 56b4639..8764914 100644 --- a/algorithms_cpp/test/zip_iterator_test.h +++ b/algorithms_cpp/test/zip_iterator_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/atomic.h b/base_c/include/embb/base/c/atomic.h index 8875432..b00b337 100644 --- a/base_c/include/embb/base/c/atomic.h +++ b/base_c/include/embb/base/c/atomic.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/base.h b/base_c/include/embb/base/c/base.h index 0251a43..bcc178a 100644 --- a/base_c/include/embb/base/c/base.h +++ b/base_c/include/embb/base/c/base.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/condition_variable.h b/base_c/include/embb/base/c/condition_variable.h index 86143cc..d707c2b 100644 --- a/base_c/include/embb/base/c/condition_variable.h +++ b/base_c/include/embb/base/c/condition_variable.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/core_set.h b/base_c/include/embb/base/c/core_set.h index 0980fef..767a3dc 100644 --- a/base_c/include/embb/base/c/core_set.h +++ b/base_c/include/embb/base/c/core_set.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/counter.h b/base_c/include/embb/base/c/counter.h index 05536a2..e38a167 100644 --- a/base_c/include/embb/base/c/counter.h +++ b/base_c/include/embb/base/c/counter.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/duration.h b/base_c/include/embb/base/c/duration.h index fe1b435..1af05db 100644 --- a/base_c/include/embb/base/c/duration.h +++ b/base_c/include/embb/base/c/duration.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/errors.h b/base_c/include/embb/base/c/errors.h index 3276dfc..fef908b 100644 --- a/base_c/include/embb/base/c/errors.h +++ b/base_c/include/embb/base/c/errors.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/internal/atomic/and_assign.h b/base_c/include/embb/base/c/internal/atomic/and_assign.h index 9a99f51..48871ca 100644 --- a/base_c/include/embb/base/c/internal/atomic/and_assign.h +++ b/base_c/include/embb/base/c/internal/atomic/and_assign.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/internal/atomic/atomic_sizes.h.in b/base_c/include/embb/base/c/internal/atomic/atomic_sizes.h.in index 972239b..26a7528 100644 --- a/base_c/include/embb/base/c/internal/atomic/atomic_sizes.h.in +++ b/base_c/include/embb/base/c/internal/atomic/atomic_sizes.h.in @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/internal/atomic/atomic_variables.h b/base_c/include/embb/base/c/internal/atomic/atomic_variables.h index 1b06df9..4c35b1e 100644 --- a/base_c/include/embb/base/c/internal/atomic/atomic_variables.h +++ b/base_c/include/embb/base/c/internal/atomic/atomic_variables.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -39,7 +39,7 @@ EMBB_ATOMIC_PARAMETER_ATOMIC_TYPE_SUFFIX) \ typedef struct \ { \ - EMBB_ATOMIC_PARAMETER_TYPE_NATIVE internal_variable; \ + volatile EMBB_ATOMIC_PARAMETER_TYPE_NATIVE internal_variable; \ } EMBB_CAT2(embb_atomic_, EMBB_ATOMIC_PARAMETER_ATOMIC_TYPE_SUFFIX); EMBB_ATOMIC_INTERNAL_DEFINE_VARIABLE(char, char) diff --git a/base_c/include/embb/base/c/internal/atomic/compare_and_swap.h b/base_c/include/embb/base/c/internal/atomic/compare_and_swap.h index bf6c273..8de4e09 100644 --- a/base_c/include/embb/base/c/internal/atomic/compare_and_swap.h +++ b/base_c/include/embb/base/c/internal/atomic/compare_and_swap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/internal/atomic/fetch_and_add.h b/base_c/include/embb/base/c/internal/atomic/fetch_and_add.h index 627c817..a165744 100644 --- a/base_c/include/embb/base/c/internal/atomic/fetch_and_add.h +++ b/base_c/include/embb/base/c/internal/atomic/fetch_and_add.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/internal/atomic/generate_atomic_implementation_template.h b/base_c/include/embb/base/c/internal/atomic/generate_atomic_implementation_template.h index 49a38f7..318b835 100644 --- a/base_c/include/embb/base/c/internal/atomic/generate_atomic_implementation_template.h +++ b/base_c/include/embb/base/c/internal/atomic/generate_atomic_implementation_template.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/internal/atomic/load.h b/base_c/include/embb/base/c/internal/atomic/load.h index 8a01f08..20094b5 100644 --- a/base_c/include/embb/base/c/internal/atomic/load.h +++ b/base_c/include/embb/base/c/internal/atomic/load.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/internal/atomic/memory_barrier.h b/base_c/include/embb/base/c/internal/atomic/memory_barrier.h index a7e0966..392366f 100644 --- a/base_c/include/embb/base/c/internal/atomic/memory_barrier.h +++ b/base_c/include/embb/base/c/internal/atomic/memory_barrier.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/internal/atomic/or_assign.h b/base_c/include/embb/base/c/internal/atomic/or_assign.h index b492529..9c76cf8 100644 --- a/base_c/include/embb/base/c/internal/atomic/or_assign.h +++ b/base_c/include/embb/base/c/internal/atomic/or_assign.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/internal/atomic/store.h b/base_c/include/embb/base/c/internal/atomic/store.h index c139f2e..fdb6a40 100644 --- a/base_c/include/embb/base/c/internal/atomic/store.h +++ b/base_c/include/embb/base/c/internal/atomic/store.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/internal/atomic/swap.h b/base_c/include/embb/base/c/internal/atomic/swap.h index 0c53f63..70c397c 100644 --- a/base_c/include/embb/base/c/internal/atomic/swap.h +++ b/base_c/include/embb/base/c/internal/atomic/swap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/internal/atomic/xor_assign.h b/base_c/include/embb/base/c/internal/atomic/xor_assign.h index 823dee0..8de71fe 100644 --- a/base_c/include/embb/base/c/internal/atomic/xor_assign.h +++ b/base_c/include/embb/base/c/internal/atomic/xor_assign.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/internal/bitset.h b/base_c/include/embb/base/c/internal/bitset.h index b32e6c7..0dd7216 100644 --- a/base_c/include/embb/base/c/internal/bitset.h +++ b/base_c/include/embb/base/c/internal/bitset.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/internal/cmake_config.h.in b/base_c/include/embb/base/c/internal/cmake_config.h.in index 12eae11..21b3048 100644 --- a/base_c/include/embb/base/c/internal/cmake_config.h.in +++ b/base_c/include/embb/base/c/internal/cmake_config.h.in @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/internal/config.h b/base_c/include/embb/base/c/internal/config.h index 3c34467..8a08174 100644 --- a/base_c/include/embb/base/c/internal/config.h +++ b/base_c/include/embb/base/c/internal/config.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/internal/macro_helper.h b/base_c/include/embb/base/c/internal/macro_helper.h index 857d71d..8d43d8c 100644 --- a/base_c/include/embb/base/c/internal/macro_helper.h +++ b/base_c/include/embb/base/c/internal/macro_helper.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/internal/platform.h b/base_c/include/embb/base/c/internal/platform.h index 7f025fc..5e21de6 100644 --- a/base_c/include/embb/base/c/internal/platform.h +++ b/base_c/include/embb/base/c/internal/platform.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/internal/thread_index.h b/base_c/include/embb/base/c/internal/thread_index.h index 0bda787..239b6e3 100644 --- a/base_c/include/embb/base/c/internal/thread_index.h +++ b/base_c/include/embb/base/c/internal/thread_index.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/internal/unused.h b/base_c/include/embb/base/c/internal/unused.h index 2109249..d68ff3a 100644 --- a/base_c/include/embb/base/c/internal/unused.h +++ b/base_c/include/embb/base/c/internal/unused.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/log.h b/base_c/include/embb/base/c/log.h index 68419c4..31c5128 100644 --- a/base_c/include/embb/base/c/log.h +++ b/base_c/include/embb/base/c/log.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -28,6 +28,7 @@ #define EMBB_BASE_C_LOG_H_ #include +#include /** * \defgroup C_LOG Logging @@ -197,6 +198,13 @@ void embb_log_error( \c message */ ); +/* function for internal use only */ +void embb_log_write_internal( + char const * channel, + embb_log_level_t log_level, + char const * message, + va_list argp); + #ifdef __cplusplus } #endif diff --git a/base_c/include/embb/base/c/memory_allocation.h b/base_c/include/embb/base/c/memory_allocation.h index c9d797d..9f2d199 100644 --- a/base_c/include/embb/base/c/memory_allocation.h +++ b/base_c/include/embb/base/c/memory_allocation.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/mutex.h b/base_c/include/embb/base/c/mutex.h index fdaabb5..ebac1d6 100644 --- a/base_c/include/embb/base/c/mutex.h +++ b/base_c/include/embb/base/c/mutex.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -179,6 +179,9 @@ int embb_spin_init( /** * Spins until the spinlock can be locked and locks it. * + * \note This method yields the current thread in regular, + * implementation-defined intervals. + * * \pre \c spinlock is initialized \n * \post If successful, \c spinlock is locked. * \return EMBB_SUCCESS if spinlock could be locked. \n diff --git a/base_c/include/embb/base/c/thread.h b/base_c/include/embb/base/c/thread.h index 0e9efd2..1d7ea11 100644 --- a/base_c/include/embb/base/c/thread.h +++ b/base_c/include/embb/base/c/thread.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/thread_specific_storage.h b/base_c/include/embb/base/c/thread_specific_storage.h index 3b70bed..31ef36a 100644 --- a/base_c/include/embb/base/c/thread_specific_storage.h +++ b/base_c/include/embb/base/c/thread_specific_storage.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/include/embb/base/c/time.h b/base_c/include/embb/base/c/time.h index a220ce7..3316253 100644 --- a/base_c/include/embb/base/c/time.h +++ b/base_c/include/embb/base/c/time.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/src/atomic.c b/base_c/src/atomic.c index e21603e..e8ea812 100644 --- a/base_c/src/atomic.c +++ b/base_c/src/atomic.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/src/condition_variable.c b/base_c/src/condition_variable.c index 575bb33..14ca240 100644 --- a/base_c/src/condition_variable.c +++ b/base_c/src/condition_variable.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/src/core_set.c b/base_c/src/core_set.c index aa142f3..3500a59 100644 --- a/base_c/src/core_set.c +++ b/base_c/src/core_set.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/src/counter.c b/base_c/src/counter.c index d71eb4d..ef16ea8 100644 --- a/base_c/src/counter.c +++ b/base_c/src/counter.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/src/duration.c b/base_c/src/duration.c index 8db8c7c..fd16a02 100644 --- a/base_c/src/duration.c +++ b/base_c/src/duration.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/src/internal/thread_index.c b/base_c/src/internal/thread_index.c index 414559b..b4c1a75 100644 --- a/base_c/src/internal/thread_index.c +++ b/base_c/src/internal/thread_index.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -144,4 +144,4 @@ void embb_internal_thread_index_reset() { embb_internal_thread_index_var = UINT_MAX; embb_counter_init(embb_thread_index_counter()); -} \ No newline at end of file +} diff --git a/base_c/src/log.c b/base_c/src/log.c index c544947..a622275 100644 --- a/base_c/src/log.c +++ b/base_c/src/log.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -59,7 +59,7 @@ void embb_log_set_log_function( embb_log_global_log_function = func; } -static void embb_log_write_internal( +void embb_log_write_internal( char const * channel, embb_log_level_t log_level, char const * message, @@ -75,18 +75,20 @@ static void embb_log_write_internal( log_context = (void*)stdout; } switch (log_level) { - case EMBB_LOG_LEVEL_INFO: - log_level_str = "INFO "; - break; case EMBB_LOG_LEVEL_ERROR: log_level_str = "ERROR"; break; + case EMBB_LOG_LEVEL_WARNING: + log_level_str = "WARN "; + break; + case EMBB_LOG_LEVEL_INFO: + log_level_str = "INFO "; + break; case EMBB_LOG_LEVEL_TRACE: log_level_str = "TRACE"; break; case EMBB_LOG_LEVEL_NONE: - case EMBB_LOG_LEVEL_WARNING: default: log_level_str = " "; break; diff --git a/base_c/src/memory_allocation.c b/base_c/src/memory_allocation.c index e1462db..8977240 100644 --- a/base_c/src/memory_allocation.c +++ b/base_c/src/memory_allocation.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/src/mutex.c b/base_c/src/mutex.c index 7e29b43..7b9a0f5 100644 --- a/base_c/src/mutex.c +++ b/base_c/src/mutex.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -25,6 +25,7 @@ */ #include +#include #include #include @@ -125,10 +126,15 @@ int embb_spin_init(embb_spinlock_t* spinlock) { int embb_spin_lock(embb_spinlock_t* spinlock) { int expected = 0; + int spins = 1; // try to swap the while (0 == embb_atomic_compare_and_swap_int( &spinlock->atomic_spin_variable_, &expected, 1)) { + if (0 == (spins & 1023)) { + embb_thread_yield(); + } + spins++; // reset expected, as CAS might change it... expected = 0; } diff --git a/base_c/src/thread.c b/base_c/src/thread.c index e7abb40..92f8bfc 100644 --- a/base_c/src/thread.c +++ b/base_c/src/thread.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/src/thread_specific_storage.c b/base_c/src/thread_specific_storage.c index fea5d18..f27e828 100644 --- a/base_c/src/thread_specific_storage.c +++ b/base_c/src/thread_specific_storage.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/src/time.c b/base_c/src/time.c index bc92363..9a07727 100644 --- a/base_c/src/time.c +++ b/base_c/src/time.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/alloc_test.cc b/base_c/test/alloc_test.cc index 3ddaf4a..840c514 100644 --- a/base_c/test/alloc_test.cc +++ b/base_c/test/alloc_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/alloc_test.h b/base_c/test/alloc_test.h index b83c8bf..62ad953 100644 --- a/base_c/test/alloc_test.h +++ b/base_c/test/alloc_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/condition_var_test.cc b/base_c/test/condition_var_test.cc index 3a526d2..8688f1b 100644 --- a/base_c/test/condition_var_test.cc +++ b/base_c/test/condition_var_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/condition_var_test.h b/base_c/test/condition_var_test.h index 23b56be..4224074 100644 --- a/base_c/test/condition_var_test.h +++ b/base_c/test/condition_var_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/core_set_test.cc b/base_c/test/core_set_test.cc index 38e8e39..f8ab25b 100644 --- a/base_c/test/core_set_test.cc +++ b/base_c/test/core_set_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/core_set_test.h b/base_c/test/core_set_test.h index 1c6dbfb..33e5996 100644 --- a/base_c/test/core_set_test.h +++ b/base_c/test/core_set_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/counter_test.cc b/base_c/test/counter_test.cc index e6b9950..2cba520 100644 --- a/base_c/test/counter_test.cc +++ b/base_c/test/counter_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/counter_test.h b/base_c/test/counter_test.h index cf3297b..9f14bfa 100644 --- a/base_c/test/counter_test.h +++ b/base_c/test/counter_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/duration_test.cc b/base_c/test/duration_test.cc index 9b93ce3..675ad68 100644 --- a/base_c/test/duration_test.cc +++ b/base_c/test/duration_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/duration_test.h b/base_c/test/duration_test.h index d2a7d2f..73aca64 100644 --- a/base_c/test/duration_test.h +++ b/base_c/test/duration_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/main.cc b/base_c/test/main.cc index 4e26f30..ad864c8 100644 --- a/base_c/test/main.cc +++ b/base_c/test/main.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/mutex_test.cc b/base_c/test/mutex_test.cc index 4c045a1..ed970df 100644 --- a/base_c/test/mutex_test.cc +++ b/base_c/test/mutex_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/mutex_test.h b/base_c/test/mutex_test.h index dfe5dda..b049933 100644 --- a/base_c/test/mutex_test.h +++ b/base_c/test/mutex_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/thread_index_test.cc b/base_c/test/thread_index_test.cc index 1dd5c13..baf2f75 100644 --- a/base_c/test/thread_index_test.cc +++ b/base_c/test/thread_index_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/thread_index_test.h b/base_c/test/thread_index_test.h index 1f07630..3452a41 100644 --- a/base_c/test/thread_index_test.h +++ b/base_c/test/thread_index_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/thread_specific_storage_test.cc b/base_c/test/thread_specific_storage_test.cc index 50e7b0c..3033e29 100644 --- a/base_c/test/thread_specific_storage_test.cc +++ b/base_c/test/thread_specific_storage_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/thread_specific_storage_test.h b/base_c/test/thread_specific_storage_test.h index 1d77e3e..ac2c7df 100644 --- a/base_c/test/thread_specific_storage_test.h +++ b/base_c/test/thread_specific_storage_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/thread_test.cc b/base_c/test/thread_test.cc index 6308f78..f5af851 100644 --- a/base_c/test/thread_test.cc +++ b/base_c/test/thread_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/thread_test.h b/base_c/test/thread_test.h index 6cdd684..149a489 100644 --- a/base_c/test/thread_test.h +++ b/base_c/test/thread_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/time_test.cc b/base_c/test/time_test.cc index 9797350..7b1b63e 100644 --- a/base_c/test/time_test.cc +++ b/base_c/test/time_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_c/test/time_test.h b/base_c/test/time_test.h index 419d26d..0cf3b84 100644 --- a/base_c/test/time_test.h +++ b/base_c/test/time_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/atomic.h b/base_cpp/include/embb/base/atomic.h index d39f494..2d00b86 100644 --- a/base_cpp/include/embb/base/atomic.h +++ b/base_cpp/include/embb/base/atomic.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -62,7 +62,7 @@ class Atomic { /** * Default constructor. * - * Constructs an atomic variable holding an uninitialized value. + * Constructs an atomic variable holding zero. * * \waitfree * diff --git a/base_cpp/include/embb/base/base.h b/base_cpp/include/embb/base/base.h index bf7e903..9bde979 100644 --- a/base_cpp/include/embb/base/base.h +++ b/base_cpp/include/embb/base/base.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/condition_variable.h b/base_cpp/include/embb/base/condition_variable.h index 8f72e5e..50dd37a 100644 --- a/base_cpp/include/embb/base/condition_variable.h +++ b/base_cpp/include/embb/base/condition_variable.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/core_set.h b/base_cpp/include/embb/base/core_set.h index 9682c0d..82599ac 100644 --- a/base_cpp/include/embb/base/core_set.h +++ b/base_cpp/include/embb/base/core_set.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/duration.h b/base_cpp/include/embb/base/duration.h index 4dbc4e4..dd66468 100644 --- a/base_cpp/include/embb/base/duration.h +++ b/base_cpp/include/embb/base/duration.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/exceptions.h b/base_cpp/include/embb/base/exceptions.h index abcc09d..9beb684 100644 --- a/base_cpp/include/embb/base/exceptions.h +++ b/base_cpp/include/embb/base/exceptions.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/function.h b/base_cpp/include/embb/base/function.h index 0abad4e..58aef0d 100644 --- a/base_cpp/include/embb/base/function.h +++ b/base_cpp/include/embb/base/function.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/atomic/atomic_arithmetic.h b/base_cpp/include/embb/base/internal/atomic/atomic_arithmetic.h index 2709dca..f9cdd25 100644 --- a/base_cpp/include/embb/base/internal/atomic/atomic_arithmetic.h +++ b/base_cpp/include/embb/base/internal/atomic/atomic_arithmetic.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/atomic/atomic_base.h b/base_cpp/include/embb/base/internal/atomic/atomic_base.h index 1be01e5..bfa3dd6 100644 --- a/base_cpp/include/embb/base/internal/atomic/atomic_base.h +++ b/base_cpp/include/embb/base/internal/atomic/atomic_base.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/atomic/atomic_implementation.h b/base_cpp/include/embb/base/internal/atomic/atomic_implementation.h index c877564..0367be7 100644 --- a/base_cpp/include/embb/base/internal/atomic/atomic_implementation.h +++ b/base_cpp/include/embb/base/internal/atomic/atomic_implementation.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/atomic/atomic_integer.h b/base_cpp/include/embb/base/internal/atomic/atomic_integer.h index 2c1476c..c609bd9 100644 --- a/base_cpp/include/embb/base/internal/atomic/atomic_integer.h +++ b/base_cpp/include/embb/base/internal/atomic/atomic_integer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/atomic/atomic_pointer.h b/base_cpp/include/embb/base/internal/atomic/atomic_pointer.h index a689054..5a5bcae 100644 --- a/base_cpp/include/embb/base/internal/atomic/atomic_pointer.h +++ b/base_cpp/include/embb/base/internal/atomic/atomic_pointer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/atomic/atomic_utility.h b/base_cpp/include/embb/base/internal/atomic/atomic_utility.h index b8051ee..89f08c9 100644 --- a/base_cpp/include/embb/base/internal/atomic/atomic_utility.h +++ b/base_cpp/include/embb/base/internal/atomic/atomic_utility.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/cmake_config.h.in b/base_cpp/include/embb/base/internal/cmake_config.h.in index 0c6d975..02226f6 100644 --- a/base_cpp/include/embb/base/internal/cmake_config.h.in +++ b/base_cpp/include/embb/base/internal/cmake_config.h.in @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/condition_variable-inl.h b/base_cpp/include/embb/base/internal/condition_variable-inl.h index 25b65aa..97f4caf 100644 --- a/base_cpp/include/embb/base/internal/condition_variable-inl.h +++ b/base_cpp/include/embb/base/internal/condition_variable-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/config.h b/base_cpp/include/embb/base/internal/config.h index ceddb94..ffab0c2 100644 --- a/base_cpp/include/embb/base/internal/config.h +++ b/base_cpp/include/embb/base/internal/config.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/duration-inl.h b/base_cpp/include/embb/base/internal/duration-inl.h index 2d502fd..982fcb7 100644 --- a/base_cpp/include/embb/base/internal/duration-inl.h +++ b/base_cpp/include/embb/base/internal/duration-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/function0.h b/base_cpp/include/embb/base/internal/function0.h index 99f9ff2..396c7da 100644 --- a/base_cpp/include/embb/base/internal/function0.h +++ b/base_cpp/include/embb/base/internal/function0.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/function1.h b/base_cpp/include/embb/base/internal/function1.h index 4951140..b880d86 100644 --- a/base_cpp/include/embb/base/internal/function1.h +++ b/base_cpp/include/embb/base/internal/function1.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/function2.h b/base_cpp/include/embb/base/internal/function2.h index 079b663..3b9f9ba 100644 --- a/base_cpp/include/embb/base/internal/function2.h +++ b/base_cpp/include/embb/base/internal/function2.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/function3.h b/base_cpp/include/embb/base/internal/function3.h index 343001b..545feca 100644 --- a/base_cpp/include/embb/base/internal/function3.h +++ b/base_cpp/include/embb/base/internal/function3.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/function4.h b/base_cpp/include/embb/base/internal/function4.h index 67de1d2..22415e5 100644 --- a/base_cpp/include/embb/base/internal/function4.h +++ b/base_cpp/include/embb/base/internal/function4.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/function5.h b/base_cpp/include/embb/base/internal/function5.h index c6ad05f..3221e57 100644 --- a/base_cpp/include/embb/base/internal/function5.h +++ b/base_cpp/include/embb/base/internal/function5.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/functionT.h b/base_cpp/include/embb/base/internal/functionT.h index 0c80b6b..9935cb7 100644 --- a/base_cpp/include/embb/base/internal/functionT.h +++ b/base_cpp/include/embb/base/internal/functionT.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/memory_allocation-inl.h b/base_cpp/include/embb/base/internal/memory_allocation-inl.h index 3f6f6cb..7565bc4 100644 --- a/base_cpp/include/embb/base/internal/memory_allocation-inl.h +++ b/base_cpp/include/embb/base/internal/memory_allocation-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/mutex-inl.h b/base_cpp/include/embb/base/internal/mutex-inl.h index e9fcb62..ffdbf12 100644 --- a/base_cpp/include/embb/base/internal/mutex-inl.h +++ b/base_cpp/include/embb/base/internal/mutex-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/nil.h b/base_cpp/include/embb/base/internal/nil.h index 5d46990..36503c0 100644 --- a/base_cpp/include/embb/base/internal/nil.h +++ b/base_cpp/include/embb/base/internal/nil.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/platform.h b/base_cpp/include/embb/base/internal/platform.h index 6258563..65b82f1 100644 --- a/base_cpp/include/embb/base/internal/platform.h +++ b/base_cpp/include/embb/base/internal/platform.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/thread-inl.h b/base_cpp/include/embb/base/internal/thread-inl.h index 454f75a..8c856f0 100644 --- a/base_cpp/include/embb/base/internal/thread-inl.h +++ b/base_cpp/include/embb/base/internal/thread-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/thread_closures.h b/base_cpp/include/embb/base/internal/thread_closures.h index 03273ac..9de9d72 100644 --- a/base_cpp/include/embb/base/internal/thread_closures.h +++ b/base_cpp/include/embb/base/internal/thread_closures.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/internal/thread_specific_storage-inl.h b/base_cpp/include/embb/base/internal/thread_specific_storage-inl.h index 00b81c3..e142aee 100644 --- a/base_cpp/include/embb/base/internal/thread_specific_storage-inl.h +++ b/base_cpp/include/embb/base/internal/thread_specific_storage-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/log.h b/base_cpp/include/embb/base/log.h new file mode 100644 index 0000000..275e95a --- /dev/null +++ b/base_cpp/include/embb/base/log.h @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef EMBB_BASE_LOG_H_ +#define EMBB_BASE_LOG_H_ + +#include + +/** + * \defgroup CPP_LOG Logging + * \ingroup CPP_BASE + * Simple logging facilities. + */ + +namespace embb { +namespace base { + +/** + * Simple logging facilities. + * + * \ingroup CPP_LOG + */ +class Log { + private: + // do not allow construction + Log(); + + public: + /** + * Sets the global log level. + * This determines what messages will be shown, messages with a more detailed + * log level will be filtered out. The default log level is EMBB_LOG_LEVEL_NONE. + * \notthreadsafe + */ + static void SetLogLevel( + embb_log_level_t log_level /**< [in] Log level to use for + filtering */ + ); + + /** + * Sets the global logging function. + * The logging function implements the mechanism for transferring log messages + * to their destination. \c context is a pointer to data the user needs in the + * function to determine where the messages should go (may be NULL if no + * additional data is needed). The default logging function is + * embb_log_write_file() with context set to \c stdout. + * \see embb_log_function_t + * \notthreadsafe + */ + static void SetLogFunction( + void * context, /**< [in] User context to supply as the + first parameter of the logging + function*/ + embb_log_function_t func /**< [in] The logging function */ + ); + + /** + * Logs a message to the given channel with the specified log level. + * If the log level is greater than the configured log level for the channel, + * the message will be ignored. + * \see embb::base::Log::SetLogLevel, embb::base::Log::SetLogFunction + * \threadsafe + */ + static void Write( + char const * channel, /**< [in] User specified channel id + for filtering the log later on. + Might be NULL, channel identifier + will be "global" in that case */ + embb_log_level_t log_level, /**< [in] Log level to use */ + char const * message, /**< [in] Message to convey, may use + \c printf style formatting */ + ... /**< Additional parameters determined + by the format specifiers in + \c message */ + ); + + /** + * Logs a message to the given channel with EMBB_LOG_LEVEL_TRACE. + * In non-debug builds, this function does nothing. + * \see embb::base::Log::Write + * \threadsafe + */ + static void Trace( + char const * channel, /**< [in] User specified channel id */ + char const * message, /**< [in] Message to convey, may use + \c printf style formatting */ + ... /**< Additional parameters determined + by the format specifiers in + \c message */ + ); + + /** + * Logs a message to the given channel with EMBB_LOG_LEVEL_INFO. + * In non-debug builds, this function does nothing. + * \see embb::base::Log::Write + * \threadsafe + */ + static void Info( + char const * channel, /**< [in] User specified channel id */ + char const * message, /**< [in] Message to convey, may use + \c printf style formatting */ + ... /**< Additional parameters determined + by the format specifiers in + \c message */ + ); + + /** + * Logs a message to the given channel with EMBB_LOG_LEVEL_WARNING. + * \see embb::base::Log::Write + * \threadsafe + */ + static void Warning( + char const * channel, /**< [in] User specified channel id */ + char const * message, /**< [in] Message to convey, may use + \c printf style formatting */ + ... /**< Additional parameters determined + by the format specifiers in + \c message */ + ); + + /** + * Logs a message to the given channel with EMBB_LOG_LEVEL_ERROR. + * \see embb::base::Log::Write + * \threadsafe + */ + static void Error( + char const * channel, /**< [in] User specified channel id */ + char const * message, /**< [in] Message to convey, may use + \c printf style formatting */ + ... /**< Additional parameters determined + by the format specifiers in + \c message */ + ); +}; + +} // namespace base +} // namespace embb + +#endif // EMBB_BASE_LOG_H_ diff --git a/base_cpp/include/embb/base/memory_allocation.h b/base_cpp/include/embb/base/memory_allocation.h index 0eb03b7..7b415a3 100644 --- a/base_cpp/include/embb/base/memory_allocation.h +++ b/base_cpp/include/embb/base/memory_allocation.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/mutex.h b/base_cpp/include/embb/base/mutex.h index c700003..bae49d6 100644 --- a/base_cpp/include/embb/base/mutex.h +++ b/base_cpp/include/embb/base/mutex.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -192,6 +192,9 @@ class Spinlock { /** * Waits until the spinlock can be locked and locks it. * + * \note This method yields the current thread in regular, + * implementation-defined intervals. + * * \pre The spinlock is not locked by the current thread. * \post The spinlock is locked. * \threadsafe diff --git a/base_cpp/include/embb/base/thread.h b/base_cpp/include/embb/base/thread.h index a2278ea..10fe983 100644 --- a/base_cpp/include/embb/base/thread.h +++ b/base_cpp/include/embb/base/thread.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/thread_specific_storage.h b/base_cpp/include/embb/base/thread_specific_storage.h index fa2191e..1f07996 100644 --- a/base_cpp/include/embb/base/thread_specific_storage.h +++ b/base_cpp/include/embb/base/thread_specific_storage.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/include/embb/base/time.h b/base_cpp/include/embb/base/time.h index 06f9ee8..f942588 100644 --- a/base_cpp/include/embb/base/time.h +++ b/base_cpp/include/embb/base/time.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/src/condition_variable.cc b/base_cpp/src/condition_variable.cc index 9a6a2a8..8124d2e 100644 --- a/base_cpp/src/condition_variable.cc +++ b/base_cpp/src/condition_variable.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/src/core_set.cc b/base_cpp/src/core_set.cc index eb7ce6b..751a373 100644 --- a/base_cpp/src/core_set.cc +++ b/base_cpp/src/core_set.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/src/duration.cc b/base_cpp/src/duration.cc index efc493f..2870ef8 100644 --- a/base_cpp/src/duration.cc +++ b/base_cpp/src/duration.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/src/function.cc b/base_cpp/src/function.cc index 118035a..3eea841 100644 --- a/base_cpp/src/function.cc +++ b/base_cpp/src/function.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/src/functionN.lua b/base_cpp/src/functionN.lua index 8a311a8..5c62f91 100644 --- a/base_cpp/src/functionN.lua +++ b/base_cpp/src/functionN.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2014-2015, Siemens AG. All rights reserved. +-- Copyright (c) 2014-2016, Siemens AG. All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/src/log.cc b/base_cpp/src/log.cc new file mode 100644 index 0000000..c2f10f3 --- /dev/null +++ b/base_cpp/src/log.cc @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +namespace embb { +namespace base { + +Log::Log() { + // empty +} + +void Log::SetLogLevel( + embb_log_level_t log_level) { + embb_log_set_log_level(log_level); +} + +void Log::SetLogFunction( + void * context, + embb_log_function_t func) { + embb_log_set_log_function(context, func); +} + +void Log::Write( + char const * channel, + embb_log_level_t log_level, + char const * message, + ...) { + va_list argp; + va_start(argp, message); + embb_log_write_internal(channel, log_level, message, argp); + va_end(argp); +} + +void Log::Trace( + char const * channel, + char const * message, + ...) { +#if defined(EMBB_DEBUG) + va_list argp; + va_start(argp, message); + embb_log_write_internal(channel, EMBB_LOG_LEVEL_TRACE, message, argp); + va_end(argp); +#else + EMBB_UNUSED(channel); + EMBB_UNUSED(message); +#endif +} + +void Log::Info( + char const * channel, + char const * message, + ...) { +#if defined(EMBB_DEBUG) + va_list argp; + va_start(argp, message); + embb_log_write_internal(channel, EMBB_LOG_LEVEL_INFO, message, argp); + va_end(argp); +#else + EMBB_UNUSED(channel); + EMBB_UNUSED(message); +#endif +} + +void Log::Warning( + char const * channel, + char const * message, + ...) { + va_list argp; + va_start(argp, message); + embb_log_write_internal(channel, EMBB_LOG_LEVEL_WARNING, message, argp); + va_end(argp); +} + +void Log::Error( + char const * channel, + char const * message, + ...) { + va_list argp; + va_start(argp, message); + embb_log_write_internal(channel, EMBB_LOG_LEVEL_ERROR, message, argp); + va_end(argp); +} + +} // namespace base +} // namespace embb diff --git a/base_cpp/src/memory_allocation.cc b/base_cpp/src/memory_allocation.cc index 73ac560..34cb28e 100644 --- a/base_cpp/src/memory_allocation.cc +++ b/base_cpp/src/memory_allocation.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/src/mutex.cc b/base_cpp/src/mutex.cc index be387f1..83dd946 100644 --- a/base_cpp/src/mutex.cc +++ b/base_cpp/src/mutex.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/src/thread.cc b/base_cpp/src/thread.cc index 6f6259e..3766dd9 100644 --- a/base_cpp/src/thread.cc +++ b/base_cpp/src/thread.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/src/time.cc b/base_cpp/src/time.cc index 8f99b01..1f827c5 100644 --- a/base_cpp/src/time.cc +++ b/base_cpp/src/time.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/test/atomic_test.cc b/base_cpp/test/atomic_test.cc index 580859c..f31d523 100644 --- a/base_cpp/test/atomic_test.cc +++ b/base_cpp/test/atomic_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/test/atomic_test.h b/base_cpp/test/atomic_test.h index 6696d29..9dea845 100644 --- a/base_cpp/test/atomic_test.h +++ b/base_cpp/test/atomic_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/test/condition_var_test.cc b/base_cpp/test/condition_var_test.cc index a023cf0..1159c38 100644 --- a/base_cpp/test/condition_var_test.cc +++ b/base_cpp/test/condition_var_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/test/condition_var_test.h b/base_cpp/test/condition_var_test.h index a2fefb7..597fc9f 100644 --- a/base_cpp/test/condition_var_test.h +++ b/base_cpp/test/condition_var_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/test/core_set_test.cc b/base_cpp/test/core_set_test.cc index 9dff77f..b23db7b 100644 --- a/base_cpp/test/core_set_test.cc +++ b/base_cpp/test/core_set_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/test/core_set_test.h b/base_cpp/test/core_set_test.h index d9579a9..bf70437 100644 --- a/base_cpp/test/core_set_test.h +++ b/base_cpp/test/core_set_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/test/duration_test.cc b/base_cpp/test/duration_test.cc index fb70d22..dcad281 100644 --- a/base_cpp/test/duration_test.cc +++ b/base_cpp/test/duration_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/test/duration_test.h b/base_cpp/test/duration_test.h index 48b8509..d36e2b5 100644 --- a/base_cpp/test/duration_test.h +++ b/base_cpp/test/duration_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/test/log_test.cc b/base_cpp/test/log_test.cc new file mode 100644 index 0000000..2109885 --- /dev/null +++ b/base_cpp/test/log_test.cc @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#include + +namespace embb { +namespace base { +namespace test { + +LogTest::LogTest() { + CreateUnit("Test all").Add(&LogTest::Test, this); +} + +static char const * logged_message; + +static void test_log_function(void * context, char const * msg) { + EMBB_UNUSED(context); + logged_message = msg; +} + +void LogTest::Test() { + using embb::base::Log; + char const * test_msg = "hello"; + char const * null = 0; + + Log::SetLogFunction(0, test_log_function); + + Log::SetLogLevel(EMBB_LOG_LEVEL_TRACE); + logged_message = null; + Log::Trace("chn", test_msg); +#ifdef EMBB_DEBUG + PT_EXPECT(0 == strcmp(logged_message, "[chn] - [TRACE] hello")); +#else + PT_EXPECT_EQ(null, logged_message); +#endif + logged_message = null; + Log::Info("chn", test_msg); +#ifdef EMBB_DEBUG + PT_EXPECT(0 == strcmp(logged_message, "[chn] - [INFO ] hello")); +#else + PT_EXPECT_EQ(null, logged_message); +#endif + logged_message = null; + Log::Warning("chn", test_msg); + PT_EXPECT(0 == strcmp(logged_message, "[chn] - [WARN ] hello")); + logged_message = null; + Log::Error("chn", test_msg); + PT_EXPECT(0 == strcmp(logged_message, "[chn] - [ERROR] hello")); + + Log::SetLogLevel(EMBB_LOG_LEVEL_INFO); + logged_message = null; + Log::Trace("chn", test_msg); + PT_EXPECT_EQ(null, logged_message); + logged_message = null; + Log::Info("chn", test_msg); +#ifdef EMBB_DEBUG + PT_EXPECT(0 == strcmp(logged_message, "[chn] - [INFO ] hello")); +#else + PT_EXPECT_EQ(null, logged_message); +#endif + logged_message = null; + Log::Warning("chn", test_msg); + PT_EXPECT(0 == strcmp(logged_message, "[chn] - [WARN ] hello")); + logged_message = null; + Log::Error("chn", test_msg); + PT_EXPECT(0 == strcmp(logged_message, "[chn] - [ERROR] hello")); + + Log::SetLogLevel(EMBB_LOG_LEVEL_WARNING); + logged_message = null; + Log::Trace("chn", test_msg); + PT_EXPECT_EQ(null, logged_message); + logged_message = null; + Log::Info("chn", test_msg); + PT_EXPECT_EQ(null, logged_message); + logged_message = null; + Log::Warning("chn", test_msg); + PT_EXPECT(0 == strcmp(logged_message, "[chn] - [WARN ] hello")); + logged_message = null; + Log::Error("chn", test_msg); + PT_EXPECT(0 == strcmp(logged_message, "[chn] - [ERROR] hello")); + + Log::SetLogLevel(EMBB_LOG_LEVEL_ERROR); + logged_message = null; + Log::Trace("chn", test_msg); + PT_EXPECT_EQ(null, logged_message); + logged_message = null; + Log::Info("chn", test_msg); + PT_EXPECT_EQ(null, logged_message); + logged_message = null; + Log::Warning("chn", test_msg); + PT_EXPECT_EQ(null, logged_message); + logged_message = null; + Log::Error("chn", test_msg); + PT_EXPECT(0 == strcmp(logged_message, "[chn] - [ERROR] hello")); + + Log::SetLogLevel(EMBB_LOG_LEVEL_NONE); + logged_message = null; + Log::Trace("chn", test_msg); + PT_EXPECT_EQ(null, logged_message); + logged_message = null; + Log::Info("chn", test_msg); + PT_EXPECT_EQ(null, logged_message); + logged_message = null; + Log::Warning("chn", test_msg); + PT_EXPECT_EQ(null, logged_message); + logged_message = null; + Log::Error("chn", test_msg); + PT_EXPECT_EQ(null, logged_message); +} + +} // namespace test +} // namespace base +} // namespace embb + + + diff --git a/base_cpp/test/log_test.h b/base_cpp/test/log_test.h new file mode 100644 index 0000000..d258a4e --- /dev/null +++ b/base_cpp/test/log_test.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef BASE_CPP_TEST_LOG_TEST_H_ +#define BASE_CPP_TEST_LOG_TEST_H_ + +#include + +namespace embb { +namespace base { +namespace test { + +/** + * Provides tests for Log. + */ +class LogTest : public partest::TestCase { + public: + /** + * Adds test methods. + */ + LogTest(); + + private: + /** + * Tests all functionalities. + */ + void Test(); +}; + +} // namespace test +} // namespace base +} // namespace embb + +#endif // BASE_CPP_TEST_LOG_TEST_H_ diff --git a/base_cpp/test/main.cc b/base_cpp/test/main.cc index 2e84368..31b57d2 100644 --- a/base_cpp/test/main.cc +++ b/base_cpp/test/main.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -34,6 +34,7 @@ #include #include #include +#include #include @@ -46,6 +47,7 @@ using embb::base::test::ThreadSpecificStorageTest; using embb::base::test::AtomicTest; using embb::base::test::MemoryAllocationTest; using embb::base::test::ThreadTest; +using embb::base::test::LogTest; PT_MAIN("Base C++") { unsigned int max_threads = @@ -61,6 +63,7 @@ PT_MAIN("Base C++") { PT_RUN(AtomicTest); PT_RUN(MemoryAllocationTest); PT_RUN(ThreadTest); + PT_RUN(LogTest); PT_EXPECT(embb_get_bytes_allocated() == 0); } diff --git a/base_cpp/test/memory_allocation_test.cc b/base_cpp/test/memory_allocation_test.cc index 8d75726..f43a66a 100644 --- a/base_cpp/test/memory_allocation_test.cc +++ b/base_cpp/test/memory_allocation_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/test/memory_allocation_test.h b/base_cpp/test/memory_allocation_test.h index 58a360a..2c1dbda 100644 --- a/base_cpp/test/memory_allocation_test.h +++ b/base_cpp/test/memory_allocation_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/test/mutex_test.cc b/base_cpp/test/mutex_test.cc index b788c6d..496b3c8 100644 --- a/base_cpp/test/mutex_test.cc +++ b/base_cpp/test/mutex_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/test/mutex_test.h b/base_cpp/test/mutex_test.h index 8f379e3..793ff90 100644 --- a/base_cpp/test/mutex_test.h +++ b/base_cpp/test/mutex_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/test/thread_specific_storage_test.cc b/base_cpp/test/thread_specific_storage_test.cc index f979b50..398af51 100644 --- a/base_cpp/test/thread_specific_storage_test.cc +++ b/base_cpp/test/thread_specific_storage_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/test/thread_specific_storage_test.h b/base_cpp/test/thread_specific_storage_test.h index 1c94e2a..7a07c5d 100644 --- a/base_cpp/test/thread_specific_storage_test.h +++ b/base_cpp/test/thread_specific_storage_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/test/thread_test.cc b/base_cpp/test/thread_test.cc index f8af461..68de306 100644 --- a/base_cpp/test/thread_test.cc +++ b/base_cpp/test/thread_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/test/thread_test.h b/base_cpp/test/thread_test.h index 3d27579..48d2f30 100644 --- a/base_cpp/test/thread_test.h +++ b/base_cpp/test/thread_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/base_cpp/test/time_test.h b/base_cpp/test/time_test.h index d49a1fb..da00d6d 100644 --- a/base_cpp/test/time_test.h +++ b/base_cpp/test/time_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/include/embb/containers/containers.h b/containers_cpp/include/embb/containers/containers.h index 8cc7c79..8e842a6 100644 --- a/containers_cpp/include/embb/containers/containers.h +++ b/containers_cpp/include/embb/containers/containers.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/include/embb/containers/internal/hazard_pointer-inl.h b/containers_cpp/include/embb/containers/internal/hazard_pointer-inl.h index 83f80aa..9e82f73 100644 --- a/containers_cpp/include/embb/containers/internal/hazard_pointer-inl.h +++ b/containers_cpp/include/embb/containers/internal/hazard_pointer-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/include/embb/containers/internal/hazard_pointer.h b/containers_cpp/include/embb/containers/internal/hazard_pointer.h index 2a25b67..25570dd 100644 --- a/containers_cpp/include/embb/containers/internal/hazard_pointer.h +++ b/containers_cpp/include/embb/containers/internal/hazard_pointer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/include/embb/containers/internal/lock_free_mpmc_queue-inl.h b/containers_cpp/include/embb/containers/internal/lock_free_mpmc_queue-inl.h index d087706..a3defd6 100644 --- a/containers_cpp/include/embb/containers/internal/lock_free_mpmc_queue-inl.h +++ b/containers_cpp/include/embb/containers/internal/lock_free_mpmc_queue-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/include/embb/containers/internal/lock_free_stack-inl.h b/containers_cpp/include/embb/containers/internal/lock_free_stack-inl.h index 5aa032a..70b409f 100644 --- a/containers_cpp/include/embb/containers/internal/lock_free_stack-inl.h +++ b/containers_cpp/include/embb/containers/internal/lock_free_stack-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -46,8 +46,8 @@ namespace internal { } template< typename T > - void LockFreeStackNode< T >::SetNext(LockFreeStackNode< T >* next) { - this->next = next; + void LockFreeStackNode< T >::SetNext(LockFreeStackNode< T >* next_to_set) { + this->next = next_to_set; } template< typename T > diff --git a/containers_cpp/include/embb/containers/internal/lock_free_tree_value_pool-inl.h b/containers_cpp/include/embb/containers/internal/lock_free_tree_value_pool-inl.h index eedc22d..83b4353 100644 --- a/containers_cpp/include/embb/containers/internal/lock_free_tree_value_pool-inl.h +++ b/containers_cpp/include/embb/containers/internal/lock_free_tree_value_pool-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/include/embb/containers/internal/object_pool-inl.h b/containers_cpp/include/embb/containers/internal/object_pool-inl.h index 9458a55..3663c29 100644 --- a/containers_cpp/include/embb/containers/internal/object_pool-inl.h +++ b/containers_cpp/include/embb/containers/internal/object_pool-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/include/embb/containers/internal/wait_free_array_value_pool-inl.h b/containers_cpp/include/embb/containers/internal/wait_free_array_value_pool-inl.h index 18ef996..049cc44 100644 --- a/containers_cpp/include/embb/containers/internal/wait_free_array_value_pool-inl.h +++ b/containers_cpp/include/embb/containers/internal/wait_free_array_value_pool-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/include/embb/containers/internal/wait_free_spsc_queue-inl.h b/containers_cpp/include/embb/containers/internal/wait_free_spsc_queue-inl.h index 352e6c8..cc605d4 100644 --- a/containers_cpp/include/embb/containers/internal/wait_free_spsc_queue-inl.h +++ b/containers_cpp/include/embb/containers/internal/wait_free_spsc_queue-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/include/embb/containers/lock_free_mpmc_queue.h b/containers_cpp/include/embb/containers/lock_free_mpmc_queue.h index 8340c53..93c07fb 100644 --- a/containers_cpp/include/embb/containers/lock_free_mpmc_queue.h +++ b/containers_cpp/include/embb/containers/lock_free_mpmc_queue.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/include/embb/containers/lock_free_stack.h b/containers_cpp/include/embb/containers/lock_free_stack.h index 7fb6d5e..ebe2079 100644 --- a/containers_cpp/include/embb/containers/lock_free_stack.h +++ b/containers_cpp/include/embb/containers/lock_free_stack.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/include/embb/containers/lock_free_tree_value_pool.h b/containers_cpp/include/embb/containers/lock_free_tree_value_pool.h index 7b218fc..3dff4cc 100644 --- a/containers_cpp/include/embb/containers/lock_free_tree_value_pool.h +++ b/containers_cpp/include/embb/containers/lock_free_tree_value_pool.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/include/embb/containers/object_pool.h b/containers_cpp/include/embb/containers/object_pool.h index 889f5cc..f8b9e5c 100644 --- a/containers_cpp/include/embb/containers/object_pool.h +++ b/containers_cpp/include/embb/containers/object_pool.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/include/embb/containers/wait_free_array_value_pool.h b/containers_cpp/include/embb/containers/wait_free_array_value_pool.h index 5a6bfda..c8a1d2f 100644 --- a/containers_cpp/include/embb/containers/wait_free_array_value_pool.h +++ b/containers_cpp/include/embb/containers/wait_free_array_value_pool.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/include/embb/containers/wait_free_spsc_queue.h b/containers_cpp/include/embb/containers/wait_free_spsc_queue.h index 30f7235..69eb8dc 100644 --- a/containers_cpp/include/embb/containers/wait_free_spsc_queue.h +++ b/containers_cpp/include/embb/containers/wait_free_spsc_queue.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/src/dummy.cc b/containers_cpp/src/dummy.cc index e95756a..c4fd49d 100644 --- a/containers_cpp/src/dummy.cc +++ b/containers_cpp/src/dummy.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/test/hazard_pointer_test.cc b/containers_cpp/test/hazard_pointer_test.cc index 71f1d2e..7a401fc 100644 --- a/containers_cpp/test/hazard_pointer_test.cc +++ b/containers_cpp/test/hazard_pointer_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -169,7 +169,7 @@ void HazardPointerTest::HazardPointerTest1ThreadMethod() { same = true; break; } - bool success = stack_->TryPush(allocated_object_from_different_thread); + success = stack_->TryPush(allocated_object_from_different_thread); PT_ASSERT(success == true); } PT_ASSERT(success_pop == true); diff --git a/containers_cpp/test/hazard_pointer_test.h b/containers_cpp/test/hazard_pointer_test.h index f6631cd..fe18def 100644 --- a/containers_cpp/test/hazard_pointer_test.h +++ b/containers_cpp/test/hazard_pointer_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/test/main.cc b/containers_cpp/test/main.cc index e4cb128..d21dede 100644 --- a/containers_cpp/test/main.cc +++ b/containers_cpp/test/main.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/test/object_pool_test-inl.h b/containers_cpp/test/object_pool_test-inl.h index db340b2..cafe7e7 100644 --- a/containers_cpp/test/object_pool_test-inl.h +++ b/containers_cpp/test/object_pool_test-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/test/object_pool_test.cc b/containers_cpp/test/object_pool_test.cc index ccc91ac..6425154 100644 --- a/containers_cpp/test/object_pool_test.cc +++ b/containers_cpp/test/object_pool_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/test/object_pool_test.h b/containers_cpp/test/object_pool_test.h index 4c5c177..92fb9e8 100644 --- a/containers_cpp/test/object_pool_test.h +++ b/containers_cpp/test/object_pool_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/test/pool_test-inl.h b/containers_cpp/test/pool_test-inl.h index 2c74935..3208775 100644 --- a/containers_cpp/test/pool_test-inl.h +++ b/containers_cpp/test/pool_test-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -165,7 +165,6 @@ void PoolTest::PoolTestStatic() { //if we allocate again, we should get those elements for (int i = 0; i != static_cast(indexes_to_free.size()); i++) { - int element, index; index = ap.Allocate(element); PT_EXPECT((index != -1)); diff --git a/containers_cpp/test/pool_test.h b/containers_cpp/test/pool_test.h index 16fcbd9..63c1586 100644 --- a/containers_cpp/test/pool_test.h +++ b/containers_cpp/test/pool_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/test/queue_test-inl.h b/containers_cpp/test/queue_test-inl.h index 3e63930..ac96b48 100644 --- a/containers_cpp/test/queue_test-inl.h +++ b/containers_cpp/test/queue_test-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/test/queue_test.h b/containers_cpp/test/queue_test.h index 22b7381..95a1585 100644 --- a/containers_cpp/test/queue_test.h +++ b/containers_cpp/test/queue_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/test/stack_test-inl.h b/containers_cpp/test/stack_test-inl.h index 6e82d4d..18ef724 100644 --- a/containers_cpp/test/stack_test-inl.h +++ b/containers_cpp/test/stack_test-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/containers_cpp/test/stack_test.h b/containers_cpp/test/stack_test.h index 449ae7e..0ea801d 100644 --- a/containers_cpp/test/stack_test.h +++ b/containers_cpp/test/stack_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/include/embb/dataflow/dataflow.h b/dataflow_cpp/include/embb/dataflow/dataflow.h index 376206f..73d6151 100644 --- a/dataflow_cpp/include/embb/dataflow/dataflow.h +++ b/dataflow_cpp/include/embb/dataflow/dataflow.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/include/embb/dataflow/internal/action.h b/dataflow_cpp/include/embb/dataflow/internal/action.h index 2b85680..61f4cfa 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/action.h +++ b/dataflow_cpp/include/embb/dataflow/internal/action.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -39,29 +39,22 @@ namespace internal { class Action { public: - Action() : node_(NULL), clock_(0), pending_(0) {} - Action(Node * node, int clock) : node_(node), clock_(clock), pending_(2) {} + Action() : node_(NULL), clock_(0) {} + Action(Node * node, int clock) : node_(node), clock_(clock) {} void RunSequential() { - pending_ = 1; node_->Run(clock_); - pending_ = 0; } void RunMTAPI(embb::tasks::TaskContext & /*context*/) { - pending_ = 1; node_->Run(clock_); - pending_ = 0; } - bool IsPending() const { return pending_ > 0; } - int GetClock() const { return clock_; } private: Node * node_; int clock_; - volatile int pending_; }; } // namespace internal diff --git a/dataflow_cpp/include/embb/dataflow/internal/clock_listener.h b/dataflow_cpp/include/embb/dataflow/internal/clock_listener.h index 5234740..deff2fc 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/clock_listener.h +++ b/dataflow_cpp/include/embb/dataflow/internal/clock_listener.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/include/embb/dataflow/internal/constant_source.h b/dataflow_cpp/include/embb/dataflow/internal/constant_source.h index 4ec14af..cb09293 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/constant_source.h +++ b/dataflow_cpp/include/embb/dataflow/internal/constant_source.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/include/embb/dataflow/internal/in.h b/dataflow_cpp/include/embb/dataflow/internal/in.h index 60b4024..666146b 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/in.h +++ b/dataflow_cpp/include/embb/dataflow/internal/in.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/include/embb/dataflow/internal/inputs.h b/dataflow_cpp/include/embb/dataflow/internal/inputs.h index 7fc87b6..211fdb5 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/inputs.h +++ b/dataflow_cpp/include/embb/dataflow/internal/inputs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/include/embb/dataflow/internal/node.h b/dataflow_cpp/include/embb/dataflow/internal/node.h index ab47fee..55c5526 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/node.h +++ b/dataflow_cpp/include/embb/dataflow/internal/node.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/include/embb/dataflow/internal/out.h b/dataflow_cpp/include/embb/dataflow/internal/out.h index 9c2f1a1..d81dae0 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/out.h +++ b/dataflow_cpp/include/embb/dataflow/internal/out.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/include/embb/dataflow/internal/outputs.h b/dataflow_cpp/include/embb/dataflow/internal/outputs.h index cf926b0..9710501 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/outputs.h +++ b/dataflow_cpp/include/embb/dataflow/internal/outputs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/include/embb/dataflow/internal/process.h b/dataflow_cpp/include/embb/dataflow/internal/process.h index 4f5bc3f..4f6ea3e 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/process.h +++ b/dataflow_cpp/include/embb/dataflow/internal/process.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -102,8 +102,9 @@ class Process< Slices, Serial, Inputs, } template - void operator >> (T & target) { + T & operator >> (T & target) { GetOutput<0>() >> target.template GetInput<0>(); + return target; } virtual void OnClock(int clock) { diff --git a/dataflow_cpp/include/embb/dataflow/internal/process_executor.h b/dataflow_cpp/include/embb/dataflow/internal/process_executor.h index 4219cea..6020417 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/process_executor.h +++ b/dataflow_cpp/include/embb/dataflow/internal/process_executor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/include/embb/dataflow/internal/scheduler.h b/dataflow_cpp/include/embb/dataflow/internal/scheduler.h index 5770217..9f86e96 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/scheduler.h +++ b/dataflow_cpp/include/embb/dataflow/internal/scheduler.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/include/embb/dataflow/internal/scheduler_mtapi.h b/dataflow_cpp/include/embb/dataflow/internal/scheduler_mtapi.h index 8f1271e..9d26bfc 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/scheduler_mtapi.h +++ b/dataflow_cpp/include/embb/dataflow/internal/scheduler_mtapi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -32,6 +32,8 @@ #include #include +#include + namespace embb { namespace dataflow { namespace internal { @@ -46,7 +48,9 @@ class SchedulerMTAPI : public Scheduler { group_[ii] = &group; } - queue_count_ = static_cast(node.GetWorkerThreadCount()); + queue_count_ = std::min( + static_cast(node.GetQueueCount()), + static_cast(node.GetWorkerThreadCount()) ); queue_ = reinterpret_cast( embb::base::Allocation::Allocate( sizeof(embb::tasks::Queue*)*queue_count_)); diff --git a/dataflow_cpp/include/embb/dataflow/internal/scheduler_sequential.h b/dataflow_cpp/include/embb/dataflow/internal/scheduler_sequential.h index 919a3a3..575fea3 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/scheduler_sequential.h +++ b/dataflow_cpp/include/embb/dataflow/internal/scheduler_sequential.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/include/embb/dataflow/internal/select.h b/dataflow_cpp/include/embb/dataflow/internal/select.h index f3a499f..85b288b 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/select.h +++ b/dataflow_cpp/include/embb/dataflow/internal/select.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -105,8 +105,9 @@ class Select } template - void operator >> (T & target) { + T & operator >> (T & target) { GetOutput<0>() >> target.template GetInput<0>(); + return target; } virtual void OnClock(int clock) { diff --git a/dataflow_cpp/include/embb/dataflow/internal/signal.h b/dataflow_cpp/include/embb/dataflow/internal/signal.h index dde39cc..4931681 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/signal.h +++ b/dataflow_cpp/include/embb/dataflow/internal/signal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/include/embb/dataflow/internal/sink.h b/dataflow_cpp/include/embb/dataflow/internal/sink.h index 2c835ed..7b76c92 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/sink.h +++ b/dataflow_cpp/include/embb/dataflow/internal/sink.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/include/embb/dataflow/internal/sink_executor.h b/dataflow_cpp/include/embb/dataflow/internal/sink_executor.h index 447602d..75bf604 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/sink_executor.h +++ b/dataflow_cpp/include/embb/dataflow/internal/sink_executor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/include/embb/dataflow/internal/source.h b/dataflow_cpp/include/embb/dataflow/internal/source.h index 72f198b..67bd37f 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/source.h +++ b/dataflow_cpp/include/embb/dataflow/internal/source.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -27,6 +27,8 @@ #ifndef EMBB_DATAFLOW_INTERNAL_SOURCE_H_ #define EMBB_DATAFLOW_INTERNAL_SOURCE_H_ +#include + #include #include #include @@ -81,14 +83,15 @@ class Source< Slices, Outputs > } template - void operator >> (T & target) { + T & operator >> (T & target) { GetOutput<0>() >> target.template GetInput<0>(); + return target; } private: OutputsType outputs_; ExecutorType executor_; - volatile bool not_done_; + embb::base::Atomic not_done_; }; } // namespace internal diff --git a/dataflow_cpp/include/embb/dataflow/internal/source_executor.h b/dataflow_cpp/include/embb/dataflow/internal/source_executor.h index 1461285..bf26ae0 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/source_executor.h +++ b/dataflow_cpp/include/embb/dataflow/internal/source_executor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -53,7 +53,9 @@ class SourceExecutor< Outputs > { Outputs & outputs) { O1 o1; bool result = function_(o1); - outputs.template Get<0>().Send(Signal(clock, o1)); + if (result) { + outputs.template Get<0>().Send(Signal(clock, o1)); + } return result; } @@ -78,8 +80,10 @@ class SourceExecutor< Outputs > { O1 o1; O2 o2; bool result = function_(o1, o2); - outputs.template Get<0>().Send(Signal(clock, o1)); - outputs.template Get<1>().Send(Signal(clock, o2)); + if (result) { + outputs.template Get<0>().Send(Signal(clock, o1)); + outputs.template Get<1>().Send(Signal(clock, o2)); + } return result; } @@ -106,9 +110,11 @@ class SourceExecutor< Outputs > { O2 o2; O3 o3; bool result = function_(o1, o2, o3); - outputs.template Get<0>().Send(Signal(clock, o1)); - outputs.template Get<1>().Send(Signal(clock, o2)); - outputs.template Get<2>().Send(Signal(clock, o3)); + if (result) { + outputs.template Get<0>().Send(Signal(clock, o1)); + outputs.template Get<1>().Send(Signal(clock, o2)); + outputs.template Get<2>().Send(Signal(clock, o3)); + } return result; } @@ -137,10 +143,12 @@ class SourceExecutor< Outputs > { O3 o3; O4 o4; bool result = function_(o1, o2, o3, o4); - outputs.template Get<0>().Send(Signal(clock, o1)); - outputs.template Get<1>().Send(Signal(clock, o2)); - outputs.template Get<2>().Send(Signal(clock, o3)); - outputs.template Get<3>().Send(Signal(clock, o4)); + if (result) { + outputs.template Get<0>().Send(Signal(clock, o1)); + outputs.template Get<1>().Send(Signal(clock, o2)); + outputs.template Get<2>().Send(Signal(clock, o3)); + outputs.template Get<3>().Send(Signal(clock, o4)); + } return result; } @@ -172,11 +180,13 @@ class SourceExecutor< Outputs > { O4 o4; O5 o5; bool result = function_(o1, o2, o3, o4, o5); - outputs.template Get<0>().Send(Signal(clock, o1)); - outputs.template Get<1>().Send(Signal(clock, o2)); - outputs.template Get<2>().Send(Signal(clock, o3)); - outputs.template Get<3>().Send(Signal(clock, o4)); - outputs.template Get<4>().Send(Signal(clock, o5)); + if (result) { + outputs.template Get<0>().Send(Signal(clock, o1)); + outputs.template Get<1>().Send(Signal(clock, o2)); + outputs.template Get<2>().Send(Signal(clock, o3)); + outputs.template Get<3>().Send(Signal(clock, o4)); + outputs.template Get<4>().Send(Signal(clock, o5)); + } return result; } diff --git a/dataflow_cpp/include/embb/dataflow/internal/switch.h b/dataflow_cpp/include/embb/dataflow/internal/switch.h index 3bf36ee..caecc20 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/switch.h +++ b/dataflow_cpp/include/embb/dataflow/internal/switch.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -103,8 +103,9 @@ class Switch } template - void operator >> (T & target) { + T & operator >> (T & target) { GetOutput<0>() >> target.template GetInput<0>(); + return target; } virtual void OnClock(int clock) { diff --git a/dataflow_cpp/include/embb/dataflow/internal/tuple.h b/dataflow_cpp/include/embb/dataflow/internal/tuple.h index f03f9ff..c5f7981 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/tuple.h +++ b/dataflow_cpp/include/embb/dataflow/internal/tuple.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/include/embb/dataflow/internal/typelist.h b/dataflow_cpp/include/embb/dataflow/internal/typelist.h index 4c25272..a193909 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/typelist.h +++ b/dataflow_cpp/include/embb/dataflow/internal/typelist.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/include/embb/dataflow/network.h b/dataflow_cpp/include/embb/dataflow/network.h index 33dbaff..94a2e1a 100644 --- a/dataflow_cpp/include/embb/dataflow/network.h +++ b/dataflow_cpp/include/embb/dataflow/network.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/src/node.cc b/dataflow_cpp/src/node.cc index 55b91c7..cc5e031 100644 --- a/dataflow_cpp/src/node.cc +++ b/dataflow_cpp/src/node.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/test/dataflow_cpp_test_simple.cc b/dataflow_cpp/test/dataflow_cpp_test_simple.cc index b434625..20ac9b3 100644 --- a/dataflow_cpp/test/dataflow_cpp_test_simple.cc +++ b/dataflow_cpp/test/dataflow_cpp_test_simple.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -56,12 +56,16 @@ embb::base::Atomic source_counter; int source_array[TEST_COUNT]; bool sourceFunc(int & out) { - out = source_counter; + if (source_counter < TEST_COUNT) { + out = source_counter; - source_array[source_counter] = out; - source_counter++; + source_array[source_counter] = out; + source_counter++; - return source_counter < TEST_COUNT; + return true; + } else { + return false; + } } embb::base::Atomic pred_counter; @@ -149,14 +153,13 @@ SimpleTest::SimpleTest() { void SimpleTest::TestBasic() { // All available cores embb::base::CoreSet core_set(true); - unsigned int num_cores = core_set.Count(); embb::tasks::Node::Initialize( MTAPI_DOMAIN_ID, MTAPI_NODE_ID, core_set, 1024, // max tasks (default: 1024) 128, // max groups (default: 128) - num_cores, // max queues (default: 16) + 2, // max queues (default: 16) 1024, // queue capacity (default: 1024) 4); // num priorities (default: 4) @@ -189,11 +192,14 @@ void SimpleTest::TestBasic() { source.GetOutput<0>() >> sw.GetInput<1>(); - source.GetOutput<0>() >> pred.GetInput<0>(); - pred.GetOutput<0>() >> sw.GetInput<0>(); + // connection chain representing the commented single connections below + source >> pred >> sw >> filter; + + //source.GetOutput<0>() >> pred.GetInput<0>(); + //pred.GetOutput<0>() >> sw.GetInput<0>(); pred.GetOutput<0>() >> sel.GetInput<0>(); - sw.GetOutput<0>() >> filter.GetInput<0>(); + //sw.GetOutput<0>() >> filter.GetInput<0>(); filter.GetOutput<0>() >> sel.GetInput<1>(); constant.GetOutput<0>() >> mult.GetInput<0>(); diff --git a/dataflow_cpp/test/dataflow_cpp_test_simple.h b/dataflow_cpp/test/dataflow_cpp_test_simple.h index b1ffea9..d4fc9c1 100644 --- a/dataflow_cpp/test/dataflow_cpp_test_simple.h +++ b/dataflow_cpp/test/dataflow_cpp_test_simple.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/test/dataflow_cpp_test_tuple.cc b/dataflow_cpp/test/dataflow_cpp_test_tuple.cc index 0d54432..640b37f 100644 --- a/dataflow_cpp/test/dataflow_cpp_test_tuple.cc +++ b/dataflow_cpp/test/dataflow_cpp_test_tuple.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/test/dataflow_cpp_test_tuple.h b/dataflow_cpp/test/dataflow_cpp_test_tuple.h index 31bc3bb..3013d50 100644 --- a/dataflow_cpp/test/dataflow_cpp_test_tuple.h +++ b/dataflow_cpp/test/dataflow_cpp_test_tuple.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/dataflow_cpp/test/main.cc b/dataflow_cpp/test/main.cc index 0db1d7c..7e09ac1 100644 --- a/dataflow_cpp/test/main.cc +++ b/dataflow_cpp/test/main.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/CMakeLists.txt b/doc/examples/CMakeLists.txt index d68a8a3..31c07d2 100644 --- a/doc/examples/CMakeLists.txt +++ b/doc/examples/CMakeLists.txt @@ -12,7 +12,7 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/../../base_cpp/include ${CMAKE_CURRENT_SOURCE_DIR}/../../mtapi_c/include ${CMAKE_CURRENT_SOURCE_DIR}/../../mtapi_c/src - ${CMAKE_CURRENT_SOURCE_DIR}/../../mtapi_network_c/include + ${CMAKE_CURRENT_SOURCE_DIR}/../../mtapi_plugins_c/mtapi_network_c/include ${CMAKE_CURRENT_SOURCE_DIR}/../../mtapi_cpp/include ${CMAKE_CURRENT_SOURCE_DIR}/../../tasks_cpp/include ${CMAKE_CURRENT_BINARY_DIR}/../../tasks_cpp/include @@ -21,12 +21,12 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../dataflow_cpp/include ) -if(OpenCL_FOUND) +if(BUILD_OPENCL_PLUGIN STREQUAL ON) # used in source code, to include opencl code add_definitions(-DEMBB_WITH_OPENCL) # add opencl includes include_directories( - ${CMAKE_CURRENT_SOURCE_DIR}/../../mtapi_opencl_c/include + ${CMAKE_CURRENT_SOURCE_DIR}/../../mtapi_plugins_c/mtapi_opencl_c/include ) # later used, to link opencl to target... set (EMBB_MTAPI_OPENCL_C_CONDITIONAL "embb_mtapi_opencl_c") diff --git a/doc/examples/algorithms/counting/counting-fragmented.cc b/doc/examples/algorithms/counting/counting-fragmented.cc index a621d8b..63a4846 100644 --- a/doc/examples/algorithms/counting/counting-fragmented.cc +++ b/doc/examples/algorithms/counting/counting-fragmented.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/algorithms/for_each/for_each-fragmented.cc b/doc/examples/algorithms/for_each/for_each-fragmented.cc index ab80a0c..99aeea4 100644 --- a/doc/examples/algorithms/for_each/for_each-fragmented.cc +++ b/doc/examples/algorithms/for_each/for_each-fragmented.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/algorithms/invoke/invoke-fragmented.cc b/doc/examples/algorithms/invoke/invoke-fragmented.cc index 94cddd2..925dbaa 100644 --- a/doc/examples/algorithms/invoke/invoke-fragmented.cc +++ b/doc/examples/algorithms/invoke/invoke-fragmented.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/algorithms/reduce/reduce-fragmented.cc b/doc/examples/algorithms/reduce/reduce-fragmented.cc index 4c9f1df..5fad70c 100644 --- a/doc/examples/algorithms/reduce/reduce-fragmented.cc +++ b/doc/examples/algorithms/reduce/reduce-fragmented.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/algorithms/scan/scan-fragmented.cc b/doc/examples/algorithms/scan/scan-fragmented.cc index 3a9c1d3..cf1e84f 100644 --- a/doc/examples/algorithms/scan/scan-fragmented.cc +++ b/doc/examples/algorithms/scan/scan-fragmented.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/algorithms/sorting/sorting-fragmented.cc b/doc/examples/algorithms/sorting/sorting-fragmented.cc index 36cb1ed..5872b63 100644 --- a/doc/examples/algorithms/sorting/sorting-fragmented.cc +++ b/doc/examples/algorithms/sorting/sorting-fragmented.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/containers/object_pool-fragmented.cc b/doc/examples/containers/object_pool-fragmented.cc index fb7ee1b..2be5dd5 100644 --- a/doc/examples/containers/object_pool-fragmented.cc +++ b/doc/examples/containers/object_pool-fragmented.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/containers/queues-fragmented.cc b/doc/examples/containers/queues-fragmented.cc index 0b6eaff..89f3a73 100644 --- a/doc/examples/containers/queues-fragmented.cc +++ b/doc/examples/containers/queues-fragmented.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/containers/queues-snippet.h b/doc/examples/containers/queues-snippet.h index 951f5c3..4e3a24b 100644 --- a/doc/examples/containers/queues-snippet.h +++ b/doc/examples/containers/queues-snippet.h @@ -4,12 +4,12 @@ int i, j; bool result = queue.TryDequeue(i); //@\label{lst:queue_lst1:fail_pop}@ assert(result == false); -for (int i = 0; i <= 4; ++i) { //@\label{lst:queue_lst1:loop1}@ +for (i = 0; i <= 4; ++i) { //@\label{lst:queue_lst1:loop1}@ result = queue.TryEnqueue(i); //@\label{lst:queue_lst1:push}@ assert(result == true); } -for (int i = 0; i <= 4; ++i) { //@\label{lst:queue_lst1:loop2}@ +for (i = 0; i <= 4; ++i) { //@\label{lst:queue_lst1:loop2}@ result = queue.TryDequeue(j); //@\label{lst:queue_lst1:pop}@ assert(result == true && i == j); //@\label{lst:queue_lst1:assert}@ } \ No newline at end of file diff --git a/doc/examples/containers/stack-fragmented.cc b/doc/examples/containers/stack-fragmented.cc index 31adda7..5da21d4 100644 --- a/doc/examples/containers/stack-fragmented.cc +++ b/doc/examples/containers/stack-fragmented.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/containers/stack-snippet.h b/doc/examples/containers/stack-snippet.h index dce744f..057ebe5 100644 --- a/doc/examples/containers/stack-snippet.h +++ b/doc/examples/containers/stack-snippet.h @@ -4,12 +4,12 @@ int i, j; bool result = stack.TryPop(i); //@\label{lst:stack_lst1:fail_pop}@ assert(result == false); -for (int i = 0; i <= 4; ++i) {//@\label{lst:stack_lst1:loop1}@ +for (i = 0; i <= 4; ++i) {//@\label{lst:stack_lst1:loop1}@ result = stack.TryPush(i); //@\label{lst:stack_lst1:push}@ assert(result == true); } -for (int i = 4; i >= 0; --i) { //@\label{lst:stack_lst1:loop2}@ +for (i = 4; i >= 0; --i) { //@\label{lst:stack_lst1:loop2}@ result = stack.TryPop(j); //@\label{lst:stack_lst1:pop}@ assert(result == true && i == j); //@\label{lst:stack_lst1:assert}@ } \ No newline at end of file diff --git a/doc/examples/dataflow/dataflow_connect-snippet.h b/doc/examples/dataflow/dataflow_connect-snippet.h index 6660f53..7c7537e 100644 --- a/doc/examples/dataflow/dataflow_connect-snippet.h +++ b/doc/examples/dataflow/dataflow_connect-snippet.h @@ -1,2 +1 @@ - read >> replace; - replace >> write; + read >> replace >> write; diff --git a/doc/examples/dataflow/dataflow_linear-fragmented.cc b/doc/examples/dataflow/dataflow_linear-fragmented.cc index 25bdacd..66c6fcc 100644 --- a/doc/examples/dataflow/dataflow_linear-fragmented.cc +++ b/doc/examples/dataflow/dataflow_linear-fragmented.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/dataflow/dataflow_nonlinear-fragmented.cc b/doc/examples/dataflow/dataflow_nonlinear-fragmented.cc index e7f419d..e3e664a 100644 --- a/doc/examples/dataflow/dataflow_nonlinear-fragmented.cc +++ b/doc/examples/dataflow/dataflow_nonlinear-fragmented.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/dataflow/dataflow_producer-snippet.h b/doc/examples/dataflow/dataflow_producer-snippet.h index ffaf79e..f76065c 100644 --- a/doc/examples/dataflow/dataflow_producer-snippet.h +++ b/doc/examples/dataflow/dataflow_producer-snippet.h @@ -3,10 +3,14 @@ class Producer { public: explicit Producer(int seed) : seed_(seed), count_(4) {} bool Run(T& x) { - // produce a new value x - x = SimpleRand(seed_); - count_--; - return count_ >= 0; + if (count_ >= 0) { + // produce a new value x + x = SimpleRand(seed_); + count_--; + return true; + } else { + return false; + } } private: diff --git a/doc/examples/dataflow/dataflow_source_function-snippet.h b/doc/examples/dataflow/dataflow_source_function-snippet.h index 6c1cdea..1afc660 100644 --- a/doc/examples/dataflow/dataflow_source_function-snippet.h +++ b/doc/examples/dataflow/dataflow_source_function-snippet.h @@ -1,4 +1,8 @@ bool SourceFunction(std::string & str) { - std::getline(file, str); - return !file.eof(); + if (!file.eof()) { + std::getline(file, str); + return true; + } else { + return false; + } } diff --git a/doc/examples/main.cc b/doc/examples/main.cc index 7888d4b..80b9c3c 100644 --- a/doc/examples/main.cc +++ b/doc/examples/main.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/mtapi/mtapi_c-fragmented.cc b/doc/examples/mtapi/mtapi_c-fragmented.cc index d543e12..735d30a 100644 --- a/doc/examples/mtapi/mtapi_c-fragmented.cc +++ b/doc/examples/mtapi/mtapi_c-fragmented.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/mtapi/mtapi_c_network-fragmented.cc b/doc/examples/mtapi/mtapi_c_network-fragmented.cc index 777e74c..0cc5026 100644 --- a/doc/examples/mtapi/mtapi_c_network-fragmented.cc +++ b/doc/examples/mtapi/mtapi_c_network-fragmented.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/mtapi/mtapi_c_opencl-fragmented.cc b/doc/examples/mtapi/mtapi_c_opencl-fragmented.cc index 074744a..ea0f67b 100644 --- a/doc/examples/mtapi/mtapi_c_opencl-fragmented.cc +++ b/doc/examples/mtapi/mtapi_c_opencl-fragmented.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/mtapi/mtapi_c_plugin-fragmented.cc b/doc/examples/mtapi/mtapi_c_plugin-fragmented.cc index b072164..bbbcc70 100644 --- a/doc/examples/mtapi/mtapi_c_plugin-fragmented.cc +++ b/doc/examples/mtapi/mtapi_c_plugin-fragmented.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/mtapi/mtapi_cpp-fragmented.cc b/doc/examples/mtapi/mtapi_cpp-fragmented.cc index d211fd9..427039e 100644 --- a/doc/examples/mtapi/mtapi_cpp-fragmented.cc +++ b/doc/examples/mtapi/mtapi_cpp-fragmented.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/stl_for_each/stl_for_each-fragmented.cc b/doc/examples/stl_for_each/stl_for_each-fragmented.cc index ecff00b..bd5aa21 100644 --- a/doc/examples/stl_for_each/stl_for_each-fragmented.cc +++ b/doc/examples/stl_for_each/stl_for_each-fragmented.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/examples/tasks/tasks_cpp-fragmented.cc b/doc/examples/tasks/tasks_cpp-fragmented.cc index 4e13885..5443760 100644 --- a/doc/examples/tasks/tasks_cpp-fragmented.cc +++ b/doc/examples/tasks/tasks_cpp-fragmented.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/doc/reference/Doxyfile.in b/doc/reference/Doxyfile.in index 8ab6642..c240844 100644 --- a/doc/reference/Doxyfile.in +++ b/doc/reference/Doxyfile.in @@ -1,4 +1,4 @@ -# Copyright (c) 2014-2015, Siemens AG. All rights reserved. +# Copyright (c) 2014-2016, Siemens AG. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -153,8 +153,8 @@ INPUT = "@CMAKE_SOURCE_DIR@/doc/reference/embb.dox" \ "@CMAKE_SOURCE_DIR@/base_cpp/include" \ "@CMAKE_SOURCE_DIR@/mtapi_c/include" \ "@CMAKE_SOURCE_DIR@/base_c/include" \ - "@CMAKE_SOURCE_DIR@/mtapi_opencl_c/include" \ - "@CMAKE_SOURCE_DIR@/mtapi_network_c/include" + "@CMAKE_SOURCE_DIR@/mtapi_plugins_c/mtapi_opencl_c/include" \ + "@CMAKE_SOURCE_DIR@/mtapi_plugins_c/mtapi_network_c/include" INPUT_ENCODING = UTF-8 FILE_PATTERNS = *.h \ diff --git a/doc/tutorial/tutorial.tex b/doc/tutorial/tutorial.tex index 4e969e1..39e3c12 100644 --- a/doc/tutorial/tutorial.tex +++ b/doc/tutorial/tutorial.tex @@ -81,7 +81,7 @@ % 1st paramter: a square(!) picture % 2nd parameter: short tile (one line) % 3rd parameter: long title (up to two lines) -\gentitlepage{pics/chicago-square.jpg}{\LARGE Siemens Corporate Technology | \monthword{\month} 2015}{\scalebox{0.9}{Embedded Multicore Building Blocks}\\\scalebox{0.9}{Introduction and Tutorial}} +\gentitlepage{pics/chicago-square.jpg}{\LARGE Siemens Corporate Technology | \monthword{\month} 2016}{\scalebox{0.9}{Embedded Multicore Building Blocks}\\\scalebox{0.9}{Introduction and Tutorial}} % List the authors and contributors on the second page, right after the cover page % 1st parameter: contributors (optional) diff --git a/mtapi_c/include/mtapi.h b/mtapi_c/include/mtapi.h index e25eb56..7ac0853 100644 --- a/mtapi_c/include/mtapi.h +++ b/mtapi_c/include/mtapi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_action_t.c b/mtapi_c/src/embb_mtapi_action_t.c index c062bdd..dff3606 100644 --- a/mtapi_c/src/embb_mtapi_action_t.c +++ b/mtapi_c/src/embb_mtapi_action_t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_action_t.h b/mtapi_c/src/embb_mtapi_action_t.h index 0d6848f..7fd7533 100644 --- a/mtapi_c/src/embb_mtapi_action_t.h +++ b/mtapi_c/src/embb_mtapi_action_t.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_action_t_fwd.h b/mtapi_c/src/embb_mtapi_action_t_fwd.h index 27944d7..f8a4a66 100644 --- a/mtapi_c/src/embb_mtapi_action_t_fwd.h +++ b/mtapi_c/src/embb_mtapi_action_t_fwd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_alloc.c b/mtapi_c/src/embb_mtapi_alloc.c index 7a5d397..5b02614 100644 --- a/mtapi_c/src/embb_mtapi_alloc.c +++ b/mtapi_c/src/embb_mtapi_alloc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_alloc.h b/mtapi_c/src/embb_mtapi_alloc.h index f5a2ec1..6644444 100644 --- a/mtapi_c/src/embb_mtapi_alloc.h +++ b/mtapi_c/src/embb_mtapi_alloc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_attr.c b/mtapi_c/src/embb_mtapi_attr.c index ca05372..fc14074 100644 --- a/mtapi_c/src/embb_mtapi_attr.c +++ b/mtapi_c/src/embb_mtapi_attr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_attr.h b/mtapi_c/src/embb_mtapi_attr.h index 46e4626..467ae09 100644 --- a/mtapi_c/src/embb_mtapi_attr.h +++ b/mtapi_c/src/embb_mtapi_attr.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_group_t.c b/mtapi_c/src/embb_mtapi_group_t.c index 9e3b0a5..4702756 100644 --- a/mtapi_c/src/embb_mtapi_group_t.c +++ b/mtapi_c/src/embb_mtapi_group_t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -55,7 +55,7 @@ void embb_mtapi_group_initialize(embb_mtapi_group_t * that) { assert(MTAPI_NULL != that); that->group_id = MTAPI_GROUP_ID_NONE; - that->deleted = MTAPI_FALSE; + embb_atomic_store_int(&that->deleted, MTAPI_FALSE); that->num_tasks.internal_variable = 0; embb_mtapi_task_queue_initialize(&that->queue); } @@ -67,7 +67,7 @@ void embb_mtapi_group_initialize_with_node( assert(MTAPI_NULL != node); that->group_id = MTAPI_GROUP_ID_NONE; - that->deleted = MTAPI_FALSE; + embb_atomic_store_int(&that->deleted, MTAPI_FALSE); that->num_tasks.internal_variable = 0; embb_mtapi_task_queue_initialize_with_capacity( &that->queue, node->attributes.queue_limit); @@ -76,7 +76,7 @@ void embb_mtapi_group_initialize_with_node( void embb_mtapi_group_finalize(embb_mtapi_group_t * that) { assert(MTAPI_NULL != that); - that->deleted = MTAPI_TRUE; + embb_atomic_store_int(&that->deleted, MTAPI_TRUE); that->num_tasks.internal_variable = 0; embb_mtapi_task_queue_finalize(&that->queue); } @@ -372,7 +372,7 @@ void mtapi_group_delete( embb_mtapi_group_pool_get_storage_for_handle( node->group_pool, group); - if (local_group->deleted) { + if (embb_atomic_load_int(&local_group->deleted)) { local_status = MTAPI_ERR_GROUP_INVALID; } else { embb_mtapi_group_finalize(local_group); diff --git a/mtapi_c/src/embb_mtapi_group_t.h b/mtapi_c/src/embb_mtapi_group_t.h index 9f4a401..9bf2932 100644 --- a/mtapi_c/src/embb_mtapi_group_t.h +++ b/mtapi_c/src/embb_mtapi_group_t.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -55,7 +55,7 @@ struct embb_mtapi_group_struct { mtapi_group_hndl_t handle; mtapi_group_id_t group_id; - volatile mtapi_boolean_t deleted; + embb_atomic_int deleted; embb_atomic_int num_tasks; mtapi_group_attributes_t attributes; embb_mtapi_task_queue_t queue; diff --git a/mtapi_c/src/embb_mtapi_group_t_fwd.h b/mtapi_c/src/embb_mtapi_group_t_fwd.h index 66233b3..6b40ec8 100644 --- a/mtapi_c/src/embb_mtapi_group_t_fwd.h +++ b/mtapi_c/src/embb_mtapi_group_t_fwd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_id_pool_t.c b/mtapi_c/src/embb_mtapi_id_pool_t.c index 0f10d96..37416e9 100644 --- a/mtapi_c/src/embb_mtapi_id_pool_t.c +++ b/mtapi_c/src/embb_mtapi_id_pool_t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_id_pool_t.h b/mtapi_c/src/embb_mtapi_id_pool_t.h index 46b04fa..d3f2616 100644 --- a/mtapi_c/src/embb_mtapi_id_pool_t.h +++ b/mtapi_c/src/embb_mtapi_id_pool_t.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_job_t.c b/mtapi_c/src/embb_mtapi_job_t.c index 227666e..3908991 100644 --- a/mtapi_c/src/embb_mtapi_job_t.c +++ b/mtapi_c/src/embb_mtapi_job_t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_job_t.h b/mtapi_c/src/embb_mtapi_job_t.h index 9e2ec88..0ca4d47 100644 --- a/mtapi_c/src/embb_mtapi_job_t.h +++ b/mtapi_c/src/embb_mtapi_job_t.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_job_t_fwd.h b/mtapi_c/src/embb_mtapi_job_t_fwd.h index c986a86..1e1bc21 100644 --- a/mtapi_c/src/embb_mtapi_job_t_fwd.h +++ b/mtapi_c/src/embb_mtapi_job_t_fwd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_log.h b/mtapi_c/src/embb_mtapi_log.h index 8f98eaf..00a521a 100644 --- a/mtapi_c/src/embb_mtapi_log.h +++ b/mtapi_c/src/embb_mtapi_log.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_node_t.c b/mtapi_c/src/embb_mtapi_node_t.c index c9ea83d..75acf4a 100644 --- a/mtapi_c/src/embb_mtapi_node_t.c +++ b/mtapi_c/src/embb_mtapi_node_t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_node_t.h b/mtapi_c/src/embb_mtapi_node_t.h index 22fca86..be16101 100644 --- a/mtapi_c/src/embb_mtapi_node_t.h +++ b/mtapi_c/src/embb_mtapi_node_t.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_node_t_fwd.h b/mtapi_c/src/embb_mtapi_node_t_fwd.h index 78ee823..f9a7e19 100644 --- a/mtapi_c/src/embb_mtapi_node_t_fwd.h +++ b/mtapi_c/src/embb_mtapi_node_t_fwd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_pool_template-inl.h b/mtapi_c/src/embb_mtapi_pool_template-inl.h index 5366972..75b607b 100644 --- a/mtapi_c/src/embb_mtapi_pool_template-inl.h +++ b/mtapi_c/src/embb_mtapi_pool_template-inl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_pool_template.h b/mtapi_c/src/embb_mtapi_pool_template.h index 1bace62..088eeaf 100644 --- a/mtapi_c/src/embb_mtapi_pool_template.h +++ b/mtapi_c/src/embb_mtapi_pool_template.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_queue_t.c b/mtapi_c/src/embb_mtapi_queue_t.c index 8288dab..1a32406 100644 --- a/mtapi_c/src/embb_mtapi_queue_t.c +++ b/mtapi_c/src/embb_mtapi_queue_t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_queue_t.h b/mtapi_c/src/embb_mtapi_queue_t.h index 37ae3fd..1f3fc35 100644 --- a/mtapi_c/src/embb_mtapi_queue_t.h +++ b/mtapi_c/src/embb_mtapi_queue_t.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_queue_t_fwd.h b/mtapi_c/src/embb_mtapi_queue_t_fwd.h index 0fb3824..23c49f4 100644 --- a/mtapi_c/src/embb_mtapi_queue_t_fwd.h +++ b/mtapi_c/src/embb_mtapi_queue_t_fwd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_scheduler_t.c b/mtapi_c/src/embb_mtapi_scheduler_t.c index acae760..1d124e8 100644 --- a/mtapi_c/src/embb_mtapi_scheduler_t.c +++ b/mtapi_c/src/embb_mtapi_scheduler_t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -302,7 +302,7 @@ int embb_mtapi_scheduler_worker(void * arg) { node->queue_pool, task->queue); } - switch (task->state) { + switch (embb_atomic_load_int(&task->state)) { case MTAPI_TASK_SCHEDULED: /* multi-instance task, another instance might be running */ case MTAPI_TASK_RUNNING: @@ -398,10 +398,12 @@ mtapi_boolean_t embb_mtapi_scheduler_wait_for_task( node->scheduler); /* now wait and schedule new tasks if we are on a worker */ + mtapi_task_state_t task_state = + (mtapi_task_state_t)embb_atomic_load_int(&task->state); while ( - (MTAPI_TASK_SCHEDULED == task->state) || - (MTAPI_TASK_RUNNING == task->state) || - (MTAPI_TASK_RETAINED == task->state) ) { + (MTAPI_TASK_SCHEDULED == task_state) || + (MTAPI_TASK_RUNNING == task_state) || + (MTAPI_TASK_RETAINED == task_state) ) { if (MTAPI_INFINITE < timeout) { embb_time_t current_time; embb_time_now(¤t_time); @@ -416,6 +418,8 @@ mtapi_boolean_t embb_mtapi_scheduler_wait_for_task( node->scheduler, node, context); + + task_state = (mtapi_task_state_t)embb_atomic_load_int(&task->state); } return MTAPI_TRUE; diff --git a/mtapi_c/src/embb_mtapi_scheduler_t.h b/mtapi_c/src/embb_mtapi_scheduler_t.h index 9b340d2..ac94a0d 100644 --- a/mtapi_c/src/embb_mtapi_scheduler_t.h +++ b/mtapi_c/src/embb_mtapi_scheduler_t.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_scheduler_t_fwd.h b/mtapi_c/src/embb_mtapi_scheduler_t_fwd.h index 454c471..09fab76 100644 --- a/mtapi_c/src/embb_mtapi_scheduler_t_fwd.h +++ b/mtapi_c/src/embb_mtapi_scheduler_t_fwd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_task_context_t.c b/mtapi_c/src/embb_mtapi_task_context_t.c index a74088a..9ca279a 100644 --- a/mtapi_c/src/embb_mtapi_task_context_t.c +++ b/mtapi_c/src/embb_mtapi_task_context_t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -187,7 +187,8 @@ mtapi_task_state_t mtapi_context_taskstate_get( &(task_context->thread_context->tss_id)); if (local_context == task_context->thread_context) { - task_state = task_context->task->state; + task_state = (mtapi_task_state_t)embb_atomic_load_int( + &task_context->task->state); local_status = MTAPI_SUCCESS; } else { local_status = MTAPI_ERR_CONTEXT_OUTOFCONTEXT; diff --git a/mtapi_c/src/embb_mtapi_task_context_t.h b/mtapi_c/src/embb_mtapi_task_context_t.h index 8763b44..26f33f6 100644 --- a/mtapi_c/src/embb_mtapi_task_context_t.h +++ b/mtapi_c/src/embb_mtapi_task_context_t.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_task_context_t_fwd.h b/mtapi_c/src/embb_mtapi_task_context_t_fwd.h index 0ecfb4e..a7c2b42 100644 --- a/mtapi_c/src/embb_mtapi_task_context_t_fwd.h +++ b/mtapi_c/src/embb_mtapi_task_context_t_fwd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_task_queue_t.c b/mtapi_c/src/embb_mtapi_task_queue_t.c index 130cda5..8bb9f7f 100644 --- a/mtapi_c/src/embb_mtapi_task_queue_t.c +++ b/mtapi_c/src/embb_mtapi_task_queue_t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_task_queue_t.h b/mtapi_c/src/embb_mtapi_task_queue_t.h index 7041db1..10df771 100644 --- a/mtapi_c/src/embb_mtapi_task_queue_t.h +++ b/mtapi_c/src/embb_mtapi_task_queue_t.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_task_queue_t_fwd.h b/mtapi_c/src/embb_mtapi_task_queue_t_fwd.h index f313556..5ad9b0d 100644 --- a/mtapi_c/src/embb_mtapi_task_queue_t_fwd.h +++ b/mtapi_c/src/embb_mtapi_task_queue_t_fwd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_task_t.c b/mtapi_c/src/embb_mtapi_task_t.c index 9a8649e..4323a13 100644 --- a/mtapi_c/src/embb_mtapi_task_t.c +++ b/mtapi_c/src/embb_mtapi_task_t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -79,7 +79,7 @@ void embb_mtapi_task_initialize(embb_mtapi_task_t* that) { that->action.id = EMBB_MTAPI_IDPOOL_INVALID_ID; that->job.id = EMBB_MTAPI_IDPOOL_INVALID_ID; - that->state = MTAPI_TASK_ERROR; + embb_atomic_store_int(&that->state, MTAPI_TASK_ERROR); that->task_id = MTAPI_TASK_ID_NONE; that->group.id = EMBB_MTAPI_IDPOOL_INVALID_ID; that->queue.id = EMBB_MTAPI_IDPOOL_INVALID_ID; @@ -159,7 +159,7 @@ void embb_mtapi_task_set_state( assert(MTAPI_NULL != that); embb_spin_lock(&that->state_lock); - that->state = state; + embb_atomic_store_int(&that->state, state); embb_atomic_memory_barrier(); embb_spin_unlock(&that->state_lock); } diff --git a/mtapi_c/src/embb_mtapi_task_t.h b/mtapi_c/src/embb_mtapi_task_t.h index ee48853..2abf41c 100644 --- a/mtapi_c/src/embb_mtapi_task_t.h +++ b/mtapi_c/src/embb_mtapi_task_t.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -66,7 +66,7 @@ struct embb_mtapi_task_struct { mtapi_action_hndl_t action; embb_spinlock_t state_lock; - volatile mtapi_task_state_t state; + embb_atomic_int state; embb_atomic_unsigned_int current_instance; embb_atomic_unsigned_int instances_todo; diff --git a/mtapi_c/src/embb_mtapi_task_t_fwd.h b/mtapi_c/src/embb_mtapi_task_t_fwd.h index f44bba4..3c3f170 100644 --- a/mtapi_c/src/embb_mtapi_task_t_fwd.h +++ b/mtapi_c/src/embb_mtapi_task_t_fwd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_task_visitor_function_t.h b/mtapi_c/src/embb_mtapi_task_visitor_function_t.h index 54d2b8c..ee2b3e4 100644 --- a/mtapi_c/src/embb_mtapi_task_visitor_function_t.h +++ b/mtapi_c/src/embb_mtapi_task_visitor_function_t.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_thread_context_t.c b/mtapi_c/src/embb_mtapi_thread_context_t.c index 2a7bdc4..a8745f8 100644 --- a/mtapi_c/src/embb_mtapi_thread_context_t.c +++ b/mtapi_c/src/embb_mtapi_thread_context_t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_thread_context_t.h b/mtapi_c/src/embb_mtapi_thread_context_t.h index a207886..9fa588f 100644 --- a/mtapi_c/src/embb_mtapi_thread_context_t.h +++ b/mtapi_c/src/embb_mtapi_thread_context_t.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/embb_mtapi_thread_context_t_fwd.h b/mtapi_c/src/embb_mtapi_thread_context_t_fwd.h index dc19293..cc05d15 100644 --- a/mtapi_c/src/embb_mtapi_thread_context_t_fwd.h +++ b/mtapi_c/src/embb_mtapi_thread_context_t_fwd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/mtapi_action_attributes_t.c b/mtapi_c/src/mtapi_action_attributes_t.c index 9cbbfce..e5db243 100644 --- a/mtapi_c/src/mtapi_action_attributes_t.c +++ b/mtapi_c/src/mtapi_action_attributes_t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/mtapi_affinity_t.c b/mtapi_c/src/mtapi_affinity_t.c index cfb0b9f..3705a4b 100644 --- a/mtapi_c/src/mtapi_affinity_t.c +++ b/mtapi_c/src/mtapi_affinity_t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/mtapi_group_attributes_t.c b/mtapi_c/src/mtapi_group_attributes_t.c index 5342bcd..c41d45c 100644 --- a/mtapi_c/src/mtapi_group_attributes_t.c +++ b/mtapi_c/src/mtapi_group_attributes_t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/mtapi_node_attributes_t.c b/mtapi_c/src/mtapi_node_attributes_t.c index 53ebf4c..18ed2c5 100644 --- a/mtapi_c/src/mtapi_node_attributes_t.c +++ b/mtapi_c/src/mtapi_node_attributes_t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/mtapi_queue_attributes_t.c b/mtapi_c/src/mtapi_queue_attributes_t.c index 6f39b0c..f41fe3c 100644 --- a/mtapi_c/src/mtapi_queue_attributes_t.c +++ b/mtapi_c/src/mtapi_queue_attributes_t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/mtapi_status_t.h b/mtapi_c/src/mtapi_status_t.h index 39fe780..c7f3c98 100644 --- a/mtapi_c/src/mtapi_status_t.h +++ b/mtapi_c/src/mtapi_status_t.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/src/mtapi_task_attributes_t.c b/mtapi_c/src/mtapi_task_attributes_t.c index 43d9004..135b948 100644 --- a/mtapi_c/src/mtapi_task_attributes_t.c +++ b/mtapi_c/src/mtapi_task_attributes_t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/test/embb_mtapi_test_config.h b/mtapi_c/test/embb_mtapi_test_config.h index fb08d64..6577c16 100644 --- a/mtapi_c/test/embb_mtapi_test_config.h +++ b/mtapi_c/test/embb_mtapi_test_config.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/test/embb_mtapi_test_error.cc b/mtapi_c/test/embb_mtapi_test_error.cc index 6b3450a..d7d8d91 100644 --- a/mtapi_c/test/embb_mtapi_test_error.cc +++ b/mtapi_c/test/embb_mtapi_test_error.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/test/embb_mtapi_test_error.h b/mtapi_c/test/embb_mtapi_test_error.h index 3759bdd..3061bb9 100644 --- a/mtapi_c/test/embb_mtapi_test_error.h +++ b/mtapi_c/test/embb_mtapi_test_error.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/test/embb_mtapi_test_group.cc b/mtapi_c/test/embb_mtapi_test_group.cc index 37f17d9..445f9be 100644 --- a/mtapi_c/test/embb_mtapi_test_group.cc +++ b/mtapi_c/test/embb_mtapi_test_group.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/test/embb_mtapi_test_group.h b/mtapi_c/test/embb_mtapi_test_group.h index 578a34e..e6501d6 100644 --- a/mtapi_c/test/embb_mtapi_test_group.h +++ b/mtapi_c/test/embb_mtapi_test_group.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/test/embb_mtapi_test_id_pool.cc b/mtapi_c/test/embb_mtapi_test_id_pool.cc index f7c7855..0ba6e62 100644 --- a/mtapi_c/test/embb_mtapi_test_id_pool.cc +++ b/mtapi_c/test/embb_mtapi_test_id_pool.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/test/embb_mtapi_test_id_pool.h b/mtapi_c/test/embb_mtapi_test_id_pool.h index a85a284..626bb4f 100644 --- a/mtapi_c/test/embb_mtapi_test_id_pool.h +++ b/mtapi_c/test/embb_mtapi_test_id_pool.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/test/embb_mtapi_test_init_finalize.cc b/mtapi_c/test/embb_mtapi_test_init_finalize.cc index 710d6c1..226919f 100644 --- a/mtapi_c/test/embb_mtapi_test_init_finalize.cc +++ b/mtapi_c/test/embb_mtapi_test_init_finalize.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/test/embb_mtapi_test_init_finalize.h b/mtapi_c/test/embb_mtapi_test_init_finalize.h index 519ba18..974237c 100644 --- a/mtapi_c/test/embb_mtapi_test_init_finalize.h +++ b/mtapi_c/test/embb_mtapi_test_init_finalize.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/test/embb_mtapi_test_queue.cc b/mtapi_c/test/embb_mtapi_test_queue.cc index 08a0933..4de48f9 100644 --- a/mtapi_c/test/embb_mtapi_test_queue.cc +++ b/mtapi_c/test/embb_mtapi_test_queue.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/test/embb_mtapi_test_queue.h b/mtapi_c/test/embb_mtapi_test_queue.h index 1e123f9..91aea99 100644 --- a/mtapi_c/test/embb_mtapi_test_queue.h +++ b/mtapi_c/test/embb_mtapi_test_queue.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/test/embb_mtapi_test_task.cc b/mtapi_c/test/embb_mtapi_test_task.cc index 8d04992..9431862 100644 --- a/mtapi_c/test/embb_mtapi_test_task.cc +++ b/mtapi_c/test/embb_mtapi_test_task.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -107,7 +107,7 @@ void TaskTest::TestBasic() { mtapi_action_hndl_t action; mtapi_job_hndl_t job; mtapi_task_hndl_t task[100]; - int ii; + mtapi_uint_t ii; embb_mtapi_log_info("running testTask...\n"); @@ -169,9 +169,9 @@ void TaskTest::TestBasic() { job = mtapi_job_get(JOB_TEST_TASK, THIS_DOMAIN_ID, &status); MTAPI_CHECK_STATUS(status); - for (ii = 0; ii < 100; ii++) { + for (ii = 0; ii < 100u; ii++) { status = MTAPI_ERR_UNKNOWN; - int arg = ii; + mtapi_uint_t arg = ii; task[ii] = mtapi_task_start( TASK_TEST_ID, job, @@ -187,7 +187,7 @@ void TaskTest::TestBasic() { testDoSomethingElse(); - for (ii = 0; ii < 100; ii++) { + for (ii = 0; ii < 100u; ii++) { status = MTAPI_ERR_UNKNOWN; mtapi_task_wait(task[ii], 100000, &status); MTAPI_CHECK_STATUS(status); @@ -227,7 +227,7 @@ void TaskTest::TestBasic() { MTAPI_CHECK_STATUS(status); mtapi_uint_t result[kTaskInstances]; - for (mtapi_uint_t ii = 0; ii < kTaskInstances; ii++) { + for (ii = 0; ii < kTaskInstances; ii++) { result[ii] = kTaskInstances + 1; } @@ -245,7 +245,7 @@ void TaskTest::TestBasic() { mtapi_task_wait(multiinstance_task, MTAPI_INFINITE, &status); MTAPI_CHECK_STATUS(status); - for (mtapi_uint_t ii = 0; ii < kTaskInstances; ii++) { + for (ii = 0; ii < kTaskInstances; ii++) { PT_EXPECT_EQ(result[ii], ii); } diff --git a/mtapi_c/test/embb_mtapi_test_task.h b/mtapi_c/test/embb_mtapi_test_task.h index 19ab8c8..bc379e7 100644 --- a/mtapi_c/test/embb_mtapi_test_task.h +++ b/mtapi_c/test/embb_mtapi_test_task.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_c/test/main.cc b/mtapi_c/test/main.cc index 85b2e57..6fb351e 100644 --- a/mtapi_c/test/main.cc +++ b/mtapi_c/test/main.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/include/embb/mtapi/action.h b/mtapi_cpp/include/embb/mtapi/action.h index 50f8d75..564ab49 100644 --- a/mtapi_cpp/include/embb/mtapi/action.h +++ b/mtapi_cpp/include/embb/mtapi/action.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/include/embb/mtapi/action_attributes.h b/mtapi_cpp/include/embb/mtapi/action_attributes.h index 70f798b..f4bbf4b 100644 --- a/mtapi_cpp/include/embb/mtapi/action_attributes.h +++ b/mtapi_cpp/include/embb/mtapi/action_attributes.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/include/embb/mtapi/affinity.h b/mtapi_cpp/include/embb/mtapi/affinity.h index c2e0cfe..1496d48 100644 --- a/mtapi_cpp/include/embb/mtapi/affinity.h +++ b/mtapi_cpp/include/embb/mtapi/affinity.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/include/embb/mtapi/group.h b/mtapi_cpp/include/embb/mtapi/group.h index 8fefc53..6d47598 100644 --- a/mtapi_cpp/include/embb/mtapi/group.h +++ b/mtapi_cpp/include/embb/mtapi/group.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/include/embb/mtapi/group_attributes.h b/mtapi_cpp/include/embb/mtapi/group_attributes.h index 3f254f2..e77d661 100644 --- a/mtapi_cpp/include/embb/mtapi/group_attributes.h +++ b/mtapi_cpp/include/embb/mtapi/group_attributes.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/include/embb/mtapi/internal/check_status.h b/mtapi_cpp/include/embb/mtapi/internal/check_status.h index 5176a4d..3a7b47a 100644 --- a/mtapi_cpp/include/embb/mtapi/internal/check_status.h +++ b/mtapi_cpp/include/embb/mtapi/internal/check_status.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/include/embb/mtapi/job.h b/mtapi_cpp/include/embb/mtapi/job.h index 50eeec9..7b4c0f9 100644 --- a/mtapi_cpp/include/embb/mtapi/job.h +++ b/mtapi_cpp/include/embb/mtapi/job.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/include/embb/mtapi/mtapi.h b/mtapi_cpp/include/embb/mtapi/mtapi.h index 8ceb6e9..35e6d26 100644 --- a/mtapi_cpp/include/embb/mtapi/mtapi.h +++ b/mtapi_cpp/include/embb/mtapi/mtapi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/include/embb/mtapi/node.h b/mtapi_cpp/include/embb/mtapi/node.h index 071cfff..115e48c 100644 --- a/mtapi_cpp/include/embb/mtapi/node.h +++ b/mtapi_cpp/include/embb/mtapi/node.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/include/embb/mtapi/node_attributes.h b/mtapi_cpp/include/embb/mtapi/node_attributes.h index 1dc104e..ae03fa7 100644 --- a/mtapi_cpp/include/embb/mtapi/node_attributes.h +++ b/mtapi_cpp/include/embb/mtapi/node_attributes.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/include/embb/mtapi/queue.h b/mtapi_cpp/include/embb/mtapi/queue.h index 43e957b..718fac3 100644 --- a/mtapi_cpp/include/embb/mtapi/queue.h +++ b/mtapi_cpp/include/embb/mtapi/queue.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/include/embb/mtapi/queue_attributes.h b/mtapi_cpp/include/embb/mtapi/queue_attributes.h index e5050b0..ee701d7 100644 --- a/mtapi_cpp/include/embb/mtapi/queue_attributes.h +++ b/mtapi_cpp/include/embb/mtapi/queue_attributes.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/include/embb/mtapi/status_exception.h b/mtapi_cpp/include/embb/mtapi/status_exception.h index 5f1504b..95e7ad5 100644 --- a/mtapi_cpp/include/embb/mtapi/status_exception.h +++ b/mtapi_cpp/include/embb/mtapi/status_exception.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/include/embb/mtapi/task.h b/mtapi_cpp/include/embb/mtapi/task.h index 40f3aaf..eaacc0c 100644 --- a/mtapi_cpp/include/embb/mtapi/task.h +++ b/mtapi_cpp/include/embb/mtapi/task.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/include/embb/mtapi/task_attributes.h b/mtapi_cpp/include/embb/mtapi/task_attributes.h index e743279..7c16094 100644 --- a/mtapi_cpp/include/embb/mtapi/task_attributes.h +++ b/mtapi_cpp/include/embb/mtapi/task_attributes.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/include/embb/mtapi/task_context.h b/mtapi_cpp/include/embb/mtapi/task_context.h index 73df784..3b8982d 100644 --- a/mtapi_cpp/include/embb/mtapi/task_context.h +++ b/mtapi_cpp/include/embb/mtapi/task_context.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/src/check_status.cc b/mtapi_cpp/src/check_status.cc index 7af10ae..50c1c2d 100644 --- a/mtapi_cpp/src/check_status.cc +++ b/mtapi_cpp/src/check_status.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/src/node.cc b/mtapi_cpp/src/node.cc index 80e9406..9b77f2c 100644 --- a/mtapi_cpp/src/node.cc +++ b/mtapi_cpp/src/node.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/test/main.cc b/mtapi_cpp/test/main.cc index 4cd6b97..2e5d7f5 100644 --- a/mtapi_cpp/test/main.cc +++ b/mtapi_cpp/test/main.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/test/mtapi_cpp_test_config.h b/mtapi_cpp/test/mtapi_cpp_test_config.h index 4b3c2d7..31c5f2c 100644 --- a/mtapi_cpp/test/mtapi_cpp_test_config.h +++ b/mtapi_cpp/test/mtapi_cpp_test_config.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/test/mtapi_cpp_test_group.cc b/mtapi_cpp/test/mtapi_cpp_test_group.cc index 610d58d..1378311 100644 --- a/mtapi_cpp/test/mtapi_cpp_test_group.cc +++ b/mtapi_cpp/test/mtapi_cpp_test_group.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/test/mtapi_cpp_test_group.h b/mtapi_cpp/test/mtapi_cpp_test_group.h index 7a1cf2c..d80973f 100644 --- a/mtapi_cpp/test/mtapi_cpp_test_group.h +++ b/mtapi_cpp/test/mtapi_cpp_test_group.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/test/mtapi_cpp_test_queue.cc b/mtapi_cpp/test/mtapi_cpp_test_queue.cc index 91a8884..8e17abf 100644 --- a/mtapi_cpp/test/mtapi_cpp_test_queue.cc +++ b/mtapi_cpp/test/mtapi_cpp_test_queue.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/test/mtapi_cpp_test_queue.h b/mtapi_cpp/test/mtapi_cpp_test_queue.h index 9659ae2..42c6c8e 100644 --- a/mtapi_cpp/test/mtapi_cpp_test_queue.h +++ b/mtapi_cpp/test/mtapi_cpp_test_queue.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/test/mtapi_cpp_test_task.cc b/mtapi_cpp/test/mtapi_cpp_test_task.cc index b21ddf7..fa3de4e 100644 --- a/mtapi_cpp/test/mtapi_cpp_test_task.cc +++ b/mtapi_cpp/test/mtapi_cpp_test_task.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_cpp/test/mtapi_cpp_test_task.h b/mtapi_cpp/test/mtapi_cpp_test_task.h index f86b6fe..f40c3bd 100644 --- a/mtapi_cpp/test/mtapi_cpp_test_task.h +++ b/mtapi_cpp/test/mtapi_cpp_test_task.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/mtapi_network_c/CMakeLists.txt b/mtapi_plugins_c/mtapi_network_c/CMakeLists.txt similarity index 87% rename from mtapi_network_c/CMakeLists.txt rename to mtapi_plugins_c/mtapi_network_c/CMakeLists.txt index c5b8fc2..a23a903 100644 --- a/mtapi_network_c/CMakeLists.txt +++ b/mtapi_plugins_c/mtapi_network_c/CMakeLists.txt @@ -26,17 +26,17 @@ GroupSourcesMSVC(test) set (EMBB_MTAPI_NETWORK_INCLUDE_DIRS "include" "src" "test") include_directories(${EMBB_MTAPI_NETWORK_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR}/../base_c/include - ${CMAKE_CURRENT_BINARY_DIR}/../base_c/include - ${CMAKE_CURRENT_SOURCE_DIR}/../mtapi_c/include - ${CMAKE_CURRENT_SOURCE_DIR}/../mtapi_c/src + ${CMAKE_CURRENT_SOURCE_DIR}/../../base_c/include + ${CMAKE_CURRENT_BINARY_DIR}/../../base_c/include + ${CMAKE_CURRENT_SOURCE_DIR}/../../mtapi_c/include + ${CMAKE_CURRENT_SOURCE_DIR}/../../mtapi_c/src ) add_library(embb_mtapi_network_c ${EMBB_MTAPI_NETWORK_C_SOURCES} ${EMBB_MTAPI_NETWORK_C_HEADERS}) target_link_libraries(embb_mtapi_network_c embb_mtapi_c embb_base_c) if (BUILD_TESTS STREQUAL ON) - include_directories(${CMAKE_CURRENT_BINARY_DIR}/../partest/include) + include_directories(${CMAKE_CURRENT_BINARY_DIR}/../../partest/include) add_executable (embb_mtapi_network_c_test ${EMBB_MTAPI_NETWORK_TEST_SOURCES}) target_link_libraries(embb_mtapi_network_c_test embb_mtapi_network_c embb_mtapi_c partest embb_base_c ${compiler_libs} ${EMBB_MTAPI_NETWORK_C_LIBS}) CopyBin(BIN embb_mtapi_network_c_test DEST ${local_install_dir}) diff --git a/mtapi_network_c/include/embb/mtapi/c/mtapi_network.h b/mtapi_plugins_c/mtapi_network_c/include/embb/mtapi/c/mtapi_network.h similarity index 100% rename from mtapi_network_c/include/embb/mtapi/c/mtapi_network.h rename to mtapi_plugins_c/mtapi_network_c/include/embb/mtapi/c/mtapi_network.h diff --git a/mtapi_network_c/src/embb_mtapi_network.c b/mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network.c similarity index 96% rename from mtapi_network_c/src/embb_mtapi_network.c rename to mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network.c index 598fe75..73a5585 100644 --- a/mtapi_network_c/src/embb_mtapi_network.c +++ b/mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network.c @@ -162,7 +162,8 @@ static void embb_mtapi_network_task_complete( send_buf, (int32_t)local_task->result_size); assert(err == 4); err = embb_mtapi_network_buffer_push_back_rawdata( - send_buf, (int32_t)local_task->result_size, local_task->result_buffer); + send_buf, (int32_t)local_task->result_size, + local_task->result_buffer); assert(err == (int)local_task->result_size); err = embb_mtapi_network_socket_sendbuffer( @@ -303,7 +304,8 @@ static int embb_mtapi_network_thread(void * args) { mtapi_taskattr_set(&task_attr, MTAPI_TASK_COMPLETE_FUNCTION, func_void, 0, &local_status); assert(local_status == MTAPI_SUCCESS); - job_hndl = mtapi_job_get((mtapi_job_id_t)job_id, (mtapi_domain_t)domain_id, &local_status); + job_hndl = mtapi_job_get((mtapi_job_id_t)job_id, + (mtapi_domain_t)domain_id, &local_status); assert(local_status == MTAPI_SUCCESS); mtapi_task_start( MTAPI_TASK_ID_NONE, job_hndl, @@ -377,7 +379,7 @@ static int embb_mtapi_network_thread(void * args) { assert(err == results_size); local_task->error_code = (mtapi_status_t)task_status; - local_task->state = MTAPI_TASK_COMPLETED; + embb_atomic_store_int(&local_task->state, MTAPI_TASK_COMPLETED); embb_atomic_fetch_and_add_int(&local_action->num_tasks, -1); /* is task associated with a group? */ @@ -530,7 +532,7 @@ static void network_task_start( assert(err == send_buf->size); embb_atomic_fetch_and_add_int(&local_action->num_tasks, 1); - local_task->state = MTAPI_TASK_RUNNING; + embb_atomic_store_int(&local_task->state, MTAPI_TASK_RUNNING); embb_mtapi_network_buffer_clear(send_buf); diff --git a/mtapi_network_c/src/embb_mtapi_network.h b/mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network.h similarity index 91% rename from mtapi_network_c/src/embb_mtapi_network.h rename to mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network.h index cc524f8..4bc5b12 100644 --- a/mtapi_network_c/src/embb_mtapi_network.h +++ b/mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network.h @@ -24,8 +24,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_H_ -#define MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_H_ +#ifndef MTAPI_PLUGINS_C_MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_H_ +#define MTAPI_PLUGINS_C_MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_H_ #include @@ -43,4 +43,4 @@ void embb_mtapi_network_finalize(); } #endif -#endif // MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_H_ +#endif // MTAPI_PLUGINS_C_MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_H_ diff --git a/mtapi_network_c/src/embb_mtapi_network_buffer.c b/mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network_buffer.c similarity index 100% rename from mtapi_network_c/src/embb_mtapi_network_buffer.c rename to mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network_buffer.c diff --git a/mtapi_network_c/src/embb_mtapi_network_buffer.h b/mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network_buffer.h similarity index 96% rename from mtapi_network_c/src/embb_mtapi_network_buffer.h rename to mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network_buffer.h index 64d6c13..2d5c306 100644 --- a/mtapi_network_c/src/embb_mtapi_network_buffer.h +++ b/mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network_buffer.h @@ -24,8 +24,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_BUFFER_H_ -#define MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_BUFFER_H_ +#ifndef MTAPI_PLUGINS_C_MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_BUFFER_H_ +#define MTAPI_PLUGINS_C_MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_BUFFER_H_ #include @@ -103,4 +103,4 @@ int embb_mtapi_network_buffer_pop_front_rawdata( } #endif -#endif // MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_BUFFER_H_ +#endif // MTAPI_PLUGINS_C_MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_BUFFER_H_ diff --git a/mtapi_network_c/src/embb_mtapi_network_socket.c b/mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network_socket.c similarity index 100% rename from mtapi_network_c/src/embb_mtapi_network_socket.c rename to mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network_socket.c diff --git a/mtapi_network_c/src/embb_mtapi_network_socket.h b/mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network_socket.h similarity index 96% rename from mtapi_network_c/src/embb_mtapi_network_socket.h rename to mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network_socket.h index 7ce7282..db568bf 100644 --- a/mtapi_network_c/src/embb_mtapi_network_socket.h +++ b/mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network_socket.h @@ -24,8 +24,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_SOCKET_H_ -#define MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_SOCKET_H_ +#ifndef MTAPI_PLUGINS_C_MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_SOCKET_H_ +#define MTAPI_PLUGINS_C_MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_SOCKET_H_ #include #include @@ -101,4 +101,4 @@ int embb_mtapi_network_socket_recvbuffer_sized( } #endif -#endif // MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_SOCKET_H_ +#endif // MTAPI_PLUGINS_C_MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_SOCKET_H_ diff --git a/mtapi_network_c/test/embb_mtapi_network_test_buffer.cc b/mtapi_plugins_c/mtapi_network_c/test/embb_mtapi_network_test_buffer.cc similarity index 100% rename from mtapi_network_c/test/embb_mtapi_network_test_buffer.cc rename to mtapi_plugins_c/mtapi_network_c/test/embb_mtapi_network_test_buffer.cc diff --git a/mtapi_network_c/test/embb_mtapi_network_test_buffer.h b/mtapi_plugins_c/mtapi_network_c/test/embb_mtapi_network_test_buffer.h similarity index 91% rename from mtapi_network_c/test/embb_mtapi_network_test_buffer.h rename to mtapi_plugins_c/mtapi_network_c/test/embb_mtapi_network_test_buffer.h index abd34bd..4c7769d 100644 --- a/mtapi_network_c/test/embb_mtapi_network_test_buffer.h +++ b/mtapi_plugins_c/mtapi_network_c/test/embb_mtapi_network_test_buffer.h @@ -24,8 +24,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef MTAPI_NETWORK_C_TEST_EMBB_MTAPI_NETWORK_TEST_BUFFER_H_ -#define MTAPI_NETWORK_C_TEST_EMBB_MTAPI_NETWORK_TEST_BUFFER_H_ +#ifndef MTAPI_PLUGINS_C_MTAPI_NETWORK_C_TEST_EMBB_MTAPI_NETWORK_TEST_BUFFER_H_ +#define MTAPI_PLUGINS_C_MTAPI_NETWORK_C_TEST_EMBB_MTAPI_NETWORK_TEST_BUFFER_H_ #include @@ -37,4 +37,4 @@ class NetworkBufferTest : public partest::TestCase { void TestBasic(); }; -#endif // MTAPI_NETWORK_C_TEST_EMBB_MTAPI_NETWORK_TEST_BUFFER_H_ +#endif // MTAPI_PLUGINS_C_MTAPI_NETWORK_C_TEST_EMBB_MTAPI_NETWORK_TEST_BUFFER_H_ diff --git a/mtapi_network_c/test/embb_mtapi_network_test_socket.cc b/mtapi_plugins_c/mtapi_network_c/test/embb_mtapi_network_test_socket.cc similarity index 100% rename from mtapi_network_c/test/embb_mtapi_network_test_socket.cc rename to mtapi_plugins_c/mtapi_network_c/test/embb_mtapi_network_test_socket.cc diff --git a/mtapi_network_c/test/embb_mtapi_network_test_socket.h b/mtapi_plugins_c/mtapi_network_c/test/embb_mtapi_network_test_socket.h similarity index 91% rename from mtapi_network_c/test/embb_mtapi_network_test_socket.h rename to mtapi_plugins_c/mtapi_network_c/test/embb_mtapi_network_test_socket.h index 6150a62..3c9ca02 100644 --- a/mtapi_network_c/test/embb_mtapi_network_test_socket.h +++ b/mtapi_plugins_c/mtapi_network_c/test/embb_mtapi_network_test_socket.h @@ -24,8 +24,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef MTAPI_NETWORK_C_TEST_EMBB_MTAPI_NETWORK_TEST_SOCKET_H_ -#define MTAPI_NETWORK_C_TEST_EMBB_MTAPI_NETWORK_TEST_SOCKET_H_ +#ifndef MTAPI_PLUGINS_C_MTAPI_NETWORK_C_TEST_EMBB_MTAPI_NETWORK_TEST_SOCKET_H_ +#define MTAPI_PLUGINS_C_MTAPI_NETWORK_C_TEST_EMBB_MTAPI_NETWORK_TEST_SOCKET_H_ #include @@ -37,4 +37,4 @@ class NetworkSocketTest : public partest::TestCase { void TestBasic(); }; -#endif // MTAPI_NETWORK_C_TEST_EMBB_MTAPI_NETWORK_TEST_SOCKET_H_ +#endif // MTAPI_PLUGINS_C_MTAPI_NETWORK_C_TEST_EMBB_MTAPI_NETWORK_TEST_SOCKET_H_ diff --git a/mtapi_network_c/test/embb_mtapi_network_test_task.cc b/mtapi_plugins_c/mtapi_network_c/test/embb_mtapi_network_test_task.cc similarity index 100% rename from mtapi_network_c/test/embb_mtapi_network_test_task.cc rename to mtapi_plugins_c/mtapi_network_c/test/embb_mtapi_network_test_task.cc diff --git a/mtapi_network_c/test/embb_mtapi_network_test_task.h b/mtapi_plugins_c/mtapi_network_c/test/embb_mtapi_network_test_task.h similarity index 91% rename from mtapi_network_c/test/embb_mtapi_network_test_task.h rename to mtapi_plugins_c/mtapi_network_c/test/embb_mtapi_network_test_task.h index 5cfbe8a..8162679 100644 --- a/mtapi_network_c/test/embb_mtapi_network_test_task.h +++ b/mtapi_plugins_c/mtapi_network_c/test/embb_mtapi_network_test_task.h @@ -24,8 +24,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef MTAPI_NETWORK_C_TEST_EMBB_MTAPI_NETWORK_TEST_TASK_H_ -#define MTAPI_NETWORK_C_TEST_EMBB_MTAPI_NETWORK_TEST_TASK_H_ +#ifndef MTAPI_PLUGINS_C_MTAPI_NETWORK_C_TEST_EMBB_MTAPI_NETWORK_TEST_TASK_H_ +#define MTAPI_PLUGINS_C_MTAPI_NETWORK_C_TEST_EMBB_MTAPI_NETWORK_TEST_TASK_H_ #include @@ -37,4 +37,4 @@ class NetworkTaskTest : public partest::TestCase { void TestBasic(); }; -#endif // MTAPI_NETWORK_C_TEST_EMBB_MTAPI_NETWORK_TEST_TASK_H_ +#endif // MTAPI_PLUGINS_C_MTAPI_NETWORK_C_TEST_EMBB_MTAPI_NETWORK_TEST_TASK_H_ diff --git a/mtapi_network_c/test/main.cc b/mtapi_plugins_c/mtapi_network_c/test/main.cc similarity index 100% rename from mtapi_network_c/test/main.cc rename to mtapi_plugins_c/mtapi_network_c/test/main.cc diff --git a/mtapi_opencl_c/CMakeLists.txt b/mtapi_plugins_c/mtapi_opencl_c/CMakeLists.txt similarity index 87% rename from mtapi_opencl_c/CMakeLists.txt rename to mtapi_plugins_c/mtapi_opencl_c/CMakeLists.txt index 6fe7561..7dd94de 100644 --- a/mtapi_opencl_c/CMakeLists.txt +++ b/mtapi_plugins_c/mtapi_opencl_c/CMakeLists.txt @@ -26,17 +26,17 @@ GroupSourcesMSVC(test) set (EMBB_MTAPI_OPENCL_INCLUDE_DIRS "include" "src" "test") include_directories(${EMBB_MTAPI_OPENCL_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR}/../base_c/include - ${CMAKE_CURRENT_BINARY_DIR}/../base_c/include - ${CMAKE_CURRENT_SOURCE_DIR}/../mtapi_c/include - ${CMAKE_CURRENT_SOURCE_DIR}/../mtapi_c/src + ${CMAKE_CURRENT_SOURCE_DIR}/../../base_c/include + ${CMAKE_CURRENT_BINARY_DIR}/../../base_c/include + ${CMAKE_CURRENT_SOURCE_DIR}/../../mtapi_c/include + ${CMAKE_CURRENT_SOURCE_DIR}/../../mtapi_c/src ) add_library(embb_mtapi_opencl_c ${EMBB_MTAPI_OPENCL_C_SOURCES} ${EMBB_MTAPI_OPENCL_C_HEADERS}) target_link_libraries(embb_mtapi_opencl_c embb_mtapi_c embb_base_c) if (BUILD_TESTS STREQUAL ON) - include_directories(${CMAKE_CURRENT_BINARY_DIR}/../partest/include) + include_directories(${CMAKE_CURRENT_BINARY_DIR}/../../partest/include) add_executable (embb_mtapi_opencl_c_test ${EMBB_MTAPI_OPENCL_TEST_SOURCES}) target_link_libraries(embb_mtapi_opencl_c_test embb_mtapi_opencl_c embb_mtapi_c partest embb_base_c ${compiler_libs} ${EMBB_MTAPI_OPENCL_C_LIBS}) CopyBin(BIN embb_mtapi_opencl_c_test DEST ${local_install_dir}) diff --git a/mtapi_opencl_c/include/embb/mtapi/c/mtapi_opencl.h b/mtapi_plugins_c/mtapi_opencl_c/include/embb/mtapi/c/mtapi_opencl.h similarity index 100% rename from mtapi_opencl_c/include/embb/mtapi/c/mtapi_opencl.h rename to mtapi_plugins_c/mtapi_opencl_c/include/embb/mtapi/c/mtapi_opencl.h diff --git a/mtapi_opencl_c/src/CL/cl.h b/mtapi_plugins_c/mtapi_opencl_c/src/CL/cl.h similarity index 100% rename from mtapi_opencl_c/src/CL/cl.h rename to mtapi_plugins_c/mtapi_opencl_c/src/CL/cl.h diff --git a/mtapi_opencl_c/src/CL/cl_ext.h b/mtapi_plugins_c/mtapi_opencl_c/src/CL/cl_ext.h similarity index 100% rename from mtapi_opencl_c/src/CL/cl_ext.h rename to mtapi_plugins_c/mtapi_opencl_c/src/CL/cl_ext.h diff --git a/mtapi_opencl_c/src/CL/cl_gl.h b/mtapi_plugins_c/mtapi_opencl_c/src/CL/cl_gl.h similarity index 100% rename from mtapi_opencl_c/src/CL/cl_gl.h rename to mtapi_plugins_c/mtapi_opencl_c/src/CL/cl_gl.h diff --git a/mtapi_opencl_c/src/CL/cl_gl_ext.h b/mtapi_plugins_c/mtapi_opencl_c/src/CL/cl_gl_ext.h similarity index 100% rename from mtapi_opencl_c/src/CL/cl_gl_ext.h rename to mtapi_plugins_c/mtapi_opencl_c/src/CL/cl_gl_ext.h diff --git a/mtapi_opencl_c/src/CL/cl_platform.h b/mtapi_plugins_c/mtapi_opencl_c/src/CL/cl_platform.h similarity index 100% rename from mtapi_opencl_c/src/CL/cl_platform.h rename to mtapi_plugins_c/mtapi_opencl_c/src/CL/cl_platform.h diff --git a/mtapi_opencl_c/src/CL/opencl.h b/mtapi_plugins_c/mtapi_opencl_c/src/CL/opencl.h similarity index 100% rename from mtapi_opencl_c/src/CL/opencl.h rename to mtapi_plugins_c/mtapi_opencl_c/src/CL/opencl.h diff --git a/mtapi_opencl_c/src/embb_mtapi_opencl.c b/mtapi_plugins_c/mtapi_opencl_c/src/embb_mtapi_opencl.c similarity index 90% rename from mtapi_opencl_c/src/embb_mtapi_opencl.c rename to mtapi_plugins_c/mtapi_opencl_c/src/embb_mtapi_opencl.c index a4b7e19..c435e73 100644 --- a/mtapi_opencl_c/src/embb_mtapi_opencl.c +++ b/mtapi_plugins_c/mtapi_opencl_c/src/embb_mtapi_opencl.c @@ -174,30 +174,40 @@ static void opencl_task_start( err = clSetKernelArg(opencl_action->kernel, 0, sizeof(cl_mem), (const void*)&opencl_task->arguments); - err = clSetKernelArg(opencl_action->kernel, 1, sizeof(cl_int), + err |= clSetKernelArg(opencl_action->kernel, 1, sizeof(cl_int), (const void*)&opencl_task->arguments_size); - err = clSetKernelArg(opencl_action->kernel, 2, sizeof(cl_mem), + err |= clSetKernelArg(opencl_action->kernel, 2, sizeof(cl_mem), (const void*)&opencl_task->result_buffer); - err = clSetKernelArg(opencl_action->kernel, 3, sizeof(cl_int), + err |= clSetKernelArg(opencl_action->kernel, 3, sizeof(cl_int), (const void*)&opencl_task->result_buffer_size); - err = clEnqueueWriteBuffer(plugin->command_queue, + err |= clEnqueueWriteBuffer(plugin->command_queue, opencl_task->arguments, CL_FALSE, 0, - (size_t)opencl_task->arguments_size, local_task->arguments, 0, NULL, NULL); - err = clEnqueueNDRangeKernel(plugin->command_queue, - opencl_action->kernel, 1, NULL, - &global_work_size, &opencl_action->local_work_size, 0, NULL, NULL); - err = clEnqueueReadBuffer(plugin->command_queue, - opencl_task->result_buffer, CL_FALSE, 0, - (size_t)opencl_task->result_buffer_size, local_task->result_buffer, - 0, NULL, &opencl_task->kernel_finish_event); - err = clSetEventCallback(opencl_task->kernel_finish_event, - CL_COMPLETE, opencl_task_complete, opencl_task); - err = clFlush(plugin->command_queue); - - embb_mtapi_task_set_state(local_task, MTAPI_TASK_RUNNING); - local_status = MTAPI_SUCCESS; + (size_t)opencl_task->arguments_size, local_task->arguments, + 0, NULL, NULL); + + if (CL_SUCCESS == err) { + embb_mtapi_task_set_state(local_task, MTAPI_TASK_RUNNING); + + err |= clEnqueueNDRangeKernel(plugin->command_queue, + opencl_action->kernel, 1, NULL, + &global_work_size, &opencl_action->local_work_size, 0, NULL, NULL); + err |= clEnqueueReadBuffer(plugin->command_queue, + opencl_task->result_buffer, CL_FALSE, 0, + (size_t)opencl_task->result_buffer_size, local_task->result_buffer, + 0, NULL, &opencl_task->kernel_finish_event); + err |= clSetEventCallback(opencl_task->kernel_finish_event, + CL_COMPLETE, opencl_task_complete, opencl_task); + } + + err |= clFlush(plugin->command_queue); + if (CL_SUCCESS != err) { + embb_mtapi_task_set_state(local_task, MTAPI_TASK_ERROR); + local_status = MTAPI_ERR_ACTION_FAILED; + } else { + local_status = MTAPI_SUCCESS; + } } } } @@ -259,7 +269,11 @@ void mtapi_opencl_plugin_initialize( embb_mtapi_opencl_plugin_t * plugin = &embb_mtapi_opencl_plugin; err = embb_mtapi_opencl_link_at_runtime(); - if (err != 0) { + if (err <= 0) { + // OpenCL not available, or wrong version + local_status = MTAPI_ERR_FUNC_NOT_IMPLEMENTED; + } else { + // all good, go ahead err = clGetPlatformIDs(1, &plugin->platform_id, NULL); if (CL_SUCCESS == err) { err = clGetDeviceIDs(plugin->platform_id, CL_DEVICE_TYPE_DEFAULT, diff --git a/mtapi_opencl_c/src/embb_mtapi_opencl_runtimelinker.c b/mtapi_plugins_c/mtapi_opencl_c/src/embb_mtapi_opencl_runtimelinker.c similarity index 99% rename from mtapi_opencl_c/src/embb_mtapi_opencl_runtimelinker.c rename to mtapi_plugins_c/mtapi_opencl_c/src/embb_mtapi_opencl_runtimelinker.c index 9396a5b..e96f9d9 100644 --- a/mtapi_opencl_c/src/embb_mtapi_opencl_runtimelinker.c +++ b/mtapi_plugins_c/mtapi_opencl_c/src/embb_mtapi_opencl_runtimelinker.c @@ -263,7 +263,7 @@ int embb_mtapi_opencl_link_at_runtime() { void * opencl_dll_handle = dlopen("libOpenCL.so", RTLD_LAZY); #endif if (opencl_dll_handle == 0) - return 0; + return -1; #ifdef EMBB_PLATFORM_COMPILER_MSVC #pragma warning(push) diff --git a/mtapi_opencl_c/src/embb_mtapi_opencl_runtimelinker.h b/mtapi_plugins_c/mtapi_opencl_c/src/embb_mtapi_opencl_runtimelinker.h similarity index 91% rename from mtapi_opencl_c/src/embb_mtapi_opencl_runtimelinker.h rename to mtapi_plugins_c/mtapi_opencl_c/src/embb_mtapi_opencl_runtimelinker.h index 7fc4256..47f7828 100644 --- a/mtapi_opencl_c/src/embb_mtapi_opencl_runtimelinker.h +++ b/mtapi_plugins_c/mtapi_opencl_c/src/embb_mtapi_opencl_runtimelinker.h @@ -24,8 +24,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef MTAPI_OPENCL_C_SRC_EMBB_MTAPI_OPENCL_RUNTIMELINKER_H_ -#define MTAPI_OPENCL_C_SRC_EMBB_MTAPI_OPENCL_RUNTIMELINKER_H_ +#ifndef MTAPI_PLUGINS_C_MTAPI_OPENCL_C_SRC_EMBB_MTAPI_OPENCL_RUNTIMELINKER_H_ +#define MTAPI_PLUGINS_C_MTAPI_OPENCL_C_SRC_EMBB_MTAPI_OPENCL_RUNTIMELINKER_H_ #ifdef __cplusplus extern "C" { @@ -37,4 +37,4 @@ int embb_mtapi_opencl_link_at_runtime(); } #endif -#endif // MTAPI_OPENCL_C_SRC_EMBB_MTAPI_OPENCL_RUNTIMELINKER_H_ +#endif // MTAPI_PLUGINS_C_MTAPI_OPENCL_C_SRC_EMBB_MTAPI_OPENCL_RUNTIMELINKER_H_ diff --git a/mtapi_opencl_c/test/embb_mtapi_opencl_test_linker.cc b/mtapi_plugins_c/mtapi_opencl_c/test/embb_mtapi_opencl_test_linker.cc similarity index 94% rename from mtapi_opencl_c/test/embb_mtapi_opencl_test_linker.cc rename to mtapi_plugins_c/mtapi_opencl_c/test/embb_mtapi_opencl_test_linker.cc index 83a81e7..246c3a4 100644 --- a/mtapi_opencl_c/test/embb_mtapi_opencl_test_linker.cc +++ b/mtapi_plugins_c/mtapi_opencl_c/test/embb_mtapi_opencl_test_linker.cc @@ -34,5 +34,7 @@ LinkerTest::LinkerTest() { } void LinkerTest::TestBasic() { - PT_EXPECT(embb_mtapi_opencl_link_at_runtime() != 0); + int result = embb_mtapi_opencl_link_at_runtime(); + bool success = result != 0; + PT_EXPECT(success); } diff --git a/mtapi_opencl_c/test/embb_mtapi_opencl_test_linker.h b/mtapi_plugins_c/mtapi_opencl_c/test/embb_mtapi_opencl_test_linker.h similarity index 91% rename from mtapi_opencl_c/test/embb_mtapi_opencl_test_linker.h rename to mtapi_plugins_c/mtapi_opencl_c/test/embb_mtapi_opencl_test_linker.h index e8c4a84..5654dd5 100644 --- a/mtapi_opencl_c/test/embb_mtapi_opencl_test_linker.h +++ b/mtapi_plugins_c/mtapi_opencl_c/test/embb_mtapi_opencl_test_linker.h @@ -24,8 +24,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef MTAPI_OPENCL_C_TEST_EMBB_MTAPI_OPENCL_TEST_LINKER_H_ -#define MTAPI_OPENCL_C_TEST_EMBB_MTAPI_OPENCL_TEST_LINKER_H_ +#ifndef MTAPI_PLUGINS_C_MTAPI_OPENCL_C_TEST_EMBB_MTAPI_OPENCL_TEST_LINKER_H_ +#define MTAPI_PLUGINS_C_MTAPI_OPENCL_C_TEST_EMBB_MTAPI_OPENCL_TEST_LINKER_H_ #include @@ -37,4 +37,4 @@ class LinkerTest : public partest::TestCase { void TestBasic(); }; -#endif // MTAPI_OPENCL_C_TEST_EMBB_MTAPI_OPENCL_TEST_LINKER_H_ +#endif // MTAPI_PLUGINS_C_MTAPI_OPENCL_C_TEST_EMBB_MTAPI_OPENCL_TEST_LINKER_H_ diff --git a/mtapi_opencl_c/test/embb_mtapi_opencl_test_task.cc b/mtapi_plugins_c/mtapi_opencl_c/test/embb_mtapi_opencl_test_task.cc similarity index 98% rename from mtapi_opencl_c/test/embb_mtapi_opencl_test_task.cc rename to mtapi_plugins_c/mtapi_opencl_c/test/embb_mtapi_opencl_test_task.cc index 61ddd31..0a922da 100644 --- a/mtapi_opencl_c/test/embb_mtapi_opencl_test_task.cc +++ b/mtapi_plugins_c/mtapi_opencl_c/test/embb_mtapi_opencl_test_task.cc @@ -75,6 +75,10 @@ void TaskTest::TestBasic() { } mtapi_opencl_plugin_initialize(&status); + if (status == MTAPI_ERR_FUNC_NOT_IMPLEMENTED) { + // OpenCL unavailable + return; + } MTAPI_CHECK_STATUS(status); mtapi_initialize( diff --git a/mtapi_opencl_c/test/embb_mtapi_opencl_test_task.h b/mtapi_plugins_c/mtapi_opencl_c/test/embb_mtapi_opencl_test_task.h similarity index 91% rename from mtapi_opencl_c/test/embb_mtapi_opencl_test_task.h rename to mtapi_plugins_c/mtapi_opencl_c/test/embb_mtapi_opencl_test_task.h index ca7545f..09f42fd 100644 --- a/mtapi_opencl_c/test/embb_mtapi_opencl_test_task.h +++ b/mtapi_plugins_c/mtapi_opencl_c/test/embb_mtapi_opencl_test_task.h @@ -24,8 +24,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef MTAPI_OPENCL_C_TEST_EMBB_MTAPI_OPENCL_TEST_TASK_H_ -#define MTAPI_OPENCL_C_TEST_EMBB_MTAPI_OPENCL_TEST_TASK_H_ +#ifndef MTAPI_PLUGINS_C_MTAPI_OPENCL_C_TEST_EMBB_MTAPI_OPENCL_TEST_TASK_H_ +#define MTAPI_PLUGINS_C_MTAPI_OPENCL_C_TEST_EMBB_MTAPI_OPENCL_TEST_TASK_H_ #include @@ -37,4 +37,4 @@ class TaskTest : public partest::TestCase { void TestBasic(); }; -#endif // MTAPI_OPENCL_C_TEST_EMBB_MTAPI_OPENCL_TEST_TASK_H_ +#endif // MTAPI_PLUGINS_C_MTAPI_OPENCL_C_TEST_EMBB_MTAPI_OPENCL_TEST_TASK_H_ diff --git a/mtapi_opencl_c/test/main.cc b/mtapi_plugins_c/mtapi_opencl_c/test/main.cc similarity index 100% rename from mtapi_opencl_c/test/main.cc rename to mtapi_plugins_c/mtapi_opencl_c/test/main.cc diff --git a/scripts/create_tarball.sh b/scripts/create_tarball.sh index a91846d..0088e8b 100755 --- a/scripts/create_tarball.sh +++ b/scripts/create_tarball.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2014-2015, Siemens AG. All rights reserved. +# Copyright (c) 2014-2016, Siemens AG. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/scripts/insert_license.sh b/scripts/insert_license.sh index 3239574..973f137 100755 --- a/scripts/insert_license.sh +++ b/scripts/insert_license.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2014-2015, Siemens AG. All rights reserved. +# Copyright (c) 2014-2016, Siemens AG. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/scripts/license.txt b/scripts/license.txt index e95756a..c4fd49d 100644 --- a/scripts/license.txt +++ b/scripts/license.txt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/scripts/license_scripts.txt b/scripts/license_scripts.txt index f6c8ca4..800b0ac 100644 --- a/scripts/license_scripts.txt +++ b/scripts/license_scripts.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2014-2015, Siemens AG. All rights reserved. +# Copyright (c) 2014-2016, Siemens AG. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/scripts/remove_license.sh b/scripts/remove_license.sh index a01d8d4..c1d08de 100755 --- a/scripts/remove_license.sh +++ b/scripts/remove_license.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2014-2015, Siemens AG. All rights reserved. +# Copyright (c) 2014-2016, Siemens AG. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/scripts/run_cpplint.sh b/scripts/run_cpplint.sh index 174414f..cec5393 100755 --- a/scripts/run_cpplint.sh +++ b/scripts/run_cpplint.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2014-2015, Siemens AG. All rights reserved. +# Copyright (c) 2014-2016, Siemens AG. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -79,7 +79,7 @@ retval=0 ##Excluded files RAND_FILES=( embb_mtapi_test_group.cc embb_mtapi_test_queue.cc embb_mtapi_test_task.cc queue_test-inl.h ) -for project in base_c mtapi_c mtapi_network_c mtapi_opencl_c base_cpp mtapi_cpp tasks_cpp algorithms_cpp containers_cpp dataflow_cpp +for project in base_c mtapi_c mtapi_plugins_c/mtapi_network_c mtapi_plugins_c/mtapi_opencl_c base_cpp mtapi_cpp tasks_cpp algorithms_cpp containers_cpp dataflow_cpp do echo "-> Doing project: $project" dir=$d/$project diff --git a/scripts/run_tests_cygwin.sh.cmake b/scripts/run_tests_cygwin.sh.cmake index 2fce866..fbbc568 100755 --- a/scripts/run_tests_cygwin.sh.cmake +++ b/scripts/run_tests_cygwin.sh.cmake @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2014-2015, Siemens AG. All rights reserved. +# Copyright (c) 2014-2016, Siemens AG. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/scripts/run_tests_unix.sh.cmake b/scripts/run_tests_unix.sh.cmake index b668b9b..70c591a 100755 --- a/scripts/run_tests_unix.sh.cmake +++ b/scripts/run_tests_unix.sh.cmake @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2014-2015, Siemens AG. All rights reserved. +# Copyright (c) 2014-2016, Siemens AG. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/scripts/run_tests_windows.bat.cmake b/scripts/run_tests_windows.bat.cmake index c3d4a44..a0a1d74 100644 --- a/scripts/run_tests_windows.bat.cmake +++ b/scripts/run_tests_windows.bat.cmake @@ -1,4 +1,4 @@ -:: Copyright (c) 2014-2015, Siemens AG. All rights reserved. +:: Copyright (c) 2014-2016, Siemens AG. All rights reserved. :: :: Redistribution and use in source and binary forms, with or without :: modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/include/embb/tasks/action.h b/tasks_cpp/include/embb/tasks/action.h index 34c22db..e034cbf 100644 --- a/tasks_cpp/include/embb/tasks/action.h +++ b/tasks_cpp/include/embb/tasks/action.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/include/embb/tasks/continuation.h b/tasks_cpp/include/embb/tasks/continuation.h index 666df75..30c2922 100644 --- a/tasks_cpp/include/embb/tasks/continuation.h +++ b/tasks_cpp/include/embb/tasks/continuation.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/include/embb/tasks/execution_policy.h b/tasks_cpp/include/embb/tasks/execution_policy.h index 8a9a019..5248900 100644 --- a/tasks_cpp/include/embb/tasks/execution_policy.h +++ b/tasks_cpp/include/embb/tasks/execution_policy.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/include/embb/tasks/group.h b/tasks_cpp/include/embb/tasks/group.h index 039fe1d..700f09e 100644 --- a/tasks_cpp/include/embb/tasks/group.h +++ b/tasks_cpp/include/embb/tasks/group.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/include/embb/tasks/internal/cmake_config.h.in b/tasks_cpp/include/embb/tasks/internal/cmake_config.h.in index 400139a..bb4ead5 100644 --- a/tasks_cpp/include/embb/tasks/internal/cmake_config.h.in +++ b/tasks_cpp/include/embb/tasks/internal/cmake_config.h.in @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/include/embb/tasks/node.h b/tasks_cpp/include/embb/tasks/node.h index 094b34d..666cab1 100644 --- a/tasks_cpp/include/embb/tasks/node.h +++ b/tasks_cpp/include/embb/tasks/node.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -120,6 +121,15 @@ class Node { static void Finalize(); /** + * Returns the number of available queues. + * \return The number of available queues + * \waitfree + */ + mtapi_uint_t GetQueueCount() const { + return queue_count_; + } + + /** * Returns the number of available cores. * \return The number of available cores * \waitfree @@ -218,11 +228,14 @@ class Node { mtapi_size_t node_local_data_size, mtapi_task_context_t * context); + mtapi_uint_t queue_count_; mtapi_uint_t core_count_; mtapi_uint_t worker_thread_count_; mtapi_action_hndl_t action_handle_; std::list queues_; std::list groups_; + embb::base::Spinlock queue_lock_; + embb::base::Spinlock group_lock_; }; } // namespace tasks diff --git a/tasks_cpp/include/embb/tasks/queue.h b/tasks_cpp/include/embb/tasks/queue.h index df9f303..a4f1479 100644 --- a/tasks_cpp/include/embb/tasks/queue.h +++ b/tasks_cpp/include/embb/tasks/queue.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/include/embb/tasks/task.h b/tasks_cpp/include/embb/tasks/task.h index fd86b40..c78d6d1 100644 --- a/tasks_cpp/include/embb/tasks/task.h +++ b/tasks_cpp/include/embb/tasks/task.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/include/embb/tasks/task_context.h b/tasks_cpp/include/embb/tasks/task_context.h index ecb416e..9aaa663 100644 --- a/tasks_cpp/include/embb/tasks/task_context.h +++ b/tasks_cpp/include/embb/tasks/task_context.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/include/embb/tasks/tasks.h b/tasks_cpp/include/embb/tasks/tasks.h index 11e8d12..bb3e3d5 100644 --- a/tasks_cpp/include/embb/tasks/tasks.h +++ b/tasks_cpp/include/embb/tasks/tasks.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/src/continuation.cc b/tasks_cpp/src/continuation.cc index 35b9d65..330fae3 100644 --- a/tasks_cpp/src/continuation.cc +++ b/tasks_cpp/src/continuation.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/src/continuationstage.h b/tasks_cpp/src/continuationstage.h index 9c1f5b0..79d260f 100644 --- a/tasks_cpp/src/continuationstage.h +++ b/tasks_cpp/src/continuationstage.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/src/execution_policy.cc b/tasks_cpp/src/execution_policy.cc index bb25954..b7e9b96 100644 --- a/tasks_cpp/src/execution_policy.cc +++ b/tasks_cpp/src/execution_policy.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -35,7 +35,7 @@ namespace tasks { ExecutionPolicy::ExecutionPolicy() : priority_(DefaultPriority) { -#if MTAPI_CPP_AUTOMATIC_INITIALIZE +#if TASKS_CPP_AUTOMATIC_INITIALIZE Node::GetInstance(); // MTAPI has to be initialized #endif mtapi_status_t status; @@ -48,7 +48,7 @@ ExecutionPolicy::ExecutionPolicy() : ExecutionPolicy::ExecutionPolicy(bool initial_affinity, mtapi_uint_t priority) :priority_(priority) { -#if MTAPI_CPP_AUTOMATIC_INITIALIZE +#if TASKS_CPP_AUTOMATIC_INITIALIZE Node::GetInstance(); // MTAPI has to be initialized #endif mtapi_status_t status; @@ -62,7 +62,7 @@ ExecutionPolicy::ExecutionPolicy(bool initial_affinity, mtapi_uint_t priority) ExecutionPolicy::ExecutionPolicy(mtapi_uint_t priority) :priority_(priority) { -#if MTAPI_CPP_AUTOMATIC_INITIALIZE +#if TASKS_CPP_AUTOMATIC_INITIALIZE Node::GetInstance(); // MTAPI has to be initialized #endif mtapi_status_t status; @@ -75,7 +75,7 @@ ExecutionPolicy::ExecutionPolicy(mtapi_uint_t priority) ExecutionPolicy::ExecutionPolicy(bool initial_affinity) :priority_(DefaultPriority) { -#if MTAPI_CPP_AUTOMATIC_INITIALIZE +#if TASKS_CPP_AUTOMATIC_INITIALIZE Node::GetInstance(); // MTAPI has to be initialized #endif mtapi_status_t status; diff --git a/tasks_cpp/src/group.cc b/tasks_cpp/src/group.cc index 709290f..04971a8 100644 --- a/tasks_cpp/src/group.cc +++ b/tasks_cpp/src/group.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/src/node.cc b/tasks_cpp/src/node.cc index 362252c..67a9425 100644 --- a/tasks_cpp/src/node.cc +++ b/tasks_cpp/src/node.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -31,6 +31,7 @@ #include #include +#include #include #if TASKS_CPP_AUTOMATIC_INITIALIZE #include @@ -74,6 +75,9 @@ Node::Node( EMBB_THROW(embb::base::ErrorException, "mtapi::Node could not initialize mtapi"); } + mtapi_node_get_attribute(node_id, MTAPI_NODE_MAX_QUEUES, &queue_count_, + sizeof(queue_count_), &status); + assert(MTAPI_SUCCESS == status); core_count_ = info.hardware_concurrency; worker_thread_count_ = embb_core_set_count(&attr->core_affinity); action_handle_ = mtapi_action_create(TASKS_CPP_JOB, action_func, @@ -234,7 +238,11 @@ void Node::Finalize() { Group & Node::CreateGroup() { Group * group = embb::base::Allocation::New(); + while (!group_lock_.TryLock(1024)) { + embb::base::Thread::CurrentYield(); + } groups_.push_back(group); + group_lock_.Unlock(); return *group; } @@ -249,7 +257,11 @@ void Node::DestroyGroup(Group & group) { Queue & Node::CreateQueue(mtapi_uint_t priority, bool ordered) { Queue * queue = embb::base::Allocation::New(priority, ordered); + while (!queue_lock_.TryLock(1024)) { + embb::base::Thread::CurrentYield(); + } queues_.push_back(queue); + queue_lock_.Unlock(); return *queue; } diff --git a/tasks_cpp/src/queue.cc b/tasks_cpp/src/queue.cc index 098f379..efc574a 100644 --- a/tasks_cpp/src/queue.cc +++ b/tasks_cpp/src/queue.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/src/task.cc b/tasks_cpp/src/task.cc index eaba40d..518b637 100644 --- a/tasks_cpp/src/task.cc +++ b/tasks_cpp/src/task.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/src/task_context.cc b/tasks_cpp/src/task_context.cc index bba9312..f863715 100644 --- a/tasks_cpp/src/task_context.cc +++ b/tasks_cpp/src/task_context.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/test/main.cc b/tasks_cpp/test/main.cc index f46b112..2f17af7 100644 --- a/tasks_cpp/test/main.cc +++ b/tasks_cpp/test/main.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/test/tasks_cpp_test_config.h b/tasks_cpp/test/tasks_cpp_test_config.h index b7244c3..cae2208 100644 --- a/tasks_cpp/test/tasks_cpp_test_config.h +++ b/tasks_cpp/test/tasks_cpp_test_config.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/test/tasks_cpp_test_group.cc b/tasks_cpp/test/tasks_cpp_test_group.cc index 2e12fae..75cab3a 100644 --- a/tasks_cpp/test/tasks_cpp_test_group.cc +++ b/tasks_cpp/test/tasks_cpp_test_group.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/test/tasks_cpp_test_group.h b/tasks_cpp/test/tasks_cpp_test_group.h index cc6c4fe..fe212ea 100644 --- a/tasks_cpp/test/tasks_cpp_test_group.h +++ b/tasks_cpp/test/tasks_cpp_test_group.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/test/tasks_cpp_test_queue.cc b/tasks_cpp/test/tasks_cpp_test_queue.cc index 17514ca..eb6bc87 100644 --- a/tasks_cpp/test/tasks_cpp_test_queue.cc +++ b/tasks_cpp/test/tasks_cpp_test_queue.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/test/tasks_cpp_test_queue.h b/tasks_cpp/test/tasks_cpp_test_queue.h index 88770ca..5c86795 100644 --- a/tasks_cpp/test/tasks_cpp_test_queue.h +++ b/tasks_cpp/test/tasks_cpp_test_queue.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/test/tasks_cpp_test_task.cc b/tasks_cpp/test/tasks_cpp_test_task.cc index 1c51631..69c56db 100644 --- a/tasks_cpp/test/tasks_cpp_test_task.cc +++ b/tasks_cpp/test/tasks_cpp_test_task.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tasks_cpp/test/tasks_cpp_test_task.h b/tasks_cpp/test/tasks_cpp_test_task.h index cbffac1..16f683b 100644 --- a/tasks_cpp/test/tasks_cpp_test_task.h +++ b/tasks_cpp/test/tasks_cpp_test_task.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, Siemens AG. All rights reserved. + * Copyright (c) 2014-2016, Siemens AG. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: