/* * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * @file queue_test_thread.h * @author Janusz Kozerski (j.kozerski@samsung.com) * @version 1.0 * @brief Implementation of class for multi-thread testing Queue */ #include #include #include #include #include #include namespace CCHECKER { #define APPS_COUNT 10 app_t app[APPS_COUNT] = { app_t ("app_id0", "###", 0, {}), app_t ("app_id1", "pkg_id1", 1, {}), app_t ("app_id2", "pkg_id2", 2, {}), app_t ("app_id3", "###", 3, {}), app_t ("app_id4", "###", 4, {}), app_t ("app_id5", "###", 5, {}), app_t ("app_id6", "###", 6, {}), app_t ("app_id7", "###", 7, {}), app_t ("app_id8", "###", 8, {}), app_t ("app_id9", "###", 9, {}) }; void TestQueue::add_events_th(int number_of_threads) { if (number_of_threads < 1) { LogDebug("Too few threads, at least 1 should be used"); number_of_threads = 1; } m_sent = 0; m_max_events = number_of_threads * 2 * APPS_COUNT; LogDebug("Running threads"); for (int i=0; i