mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 08:51:10 +02:00
cc_item_text: add global mutex
This commit is contained in:
@@ -36,7 +36,6 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <system/debug.h>
|
#include <system/debug.h>
|
||||||
#include <mutex>
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@@ -140,6 +139,8 @@ void CComponentsText::initCBox()
|
|||||||
|
|
||||||
void CComponentsText::initCCText()
|
void CComponentsText::initCCText()
|
||||||
{
|
{
|
||||||
|
std::lock_guard<std::mutex> g(ct_mutex);
|
||||||
|
|
||||||
//set default font, if is no font definied
|
//set default font, if is no font definied
|
||||||
if (ct_font == NULL)
|
if (ct_font == NULL)
|
||||||
ct_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO];
|
ct_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO];
|
||||||
|
@@ -31,6 +31,7 @@
|
|||||||
#include "cc_text_screen.h"
|
#include "cc_text_screen.h"
|
||||||
#include <gui/widget/textbox.h>
|
#include <gui/widget/textbox.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
//! Sub class of CComponentsItem. Shows a text box.
|
//! Sub class of CComponentsItem. Shows a text box.
|
||||||
/*!
|
/*!
|
||||||
@@ -76,6 +77,8 @@ class CComponentsText : public CCTextScreen, public CComponentsItem
|
|||||||
///helper: convert int to string
|
///helper: convert int to string
|
||||||
static std::string iToString(int int_val); //helper to convert int to string
|
static std::string iToString(int int_val); //helper to convert int to string
|
||||||
|
|
||||||
|
std::mutex ct_mutex;
|
||||||
|
|
||||||
///initialize all required attributes
|
///initialize all required attributes
|
||||||
void initVarText( const int x_pos, const int y_pos, const int w, const int h,
|
void initVarText( const int x_pos, const int y_pos, const int w, const int h,
|
||||||
std::string text,
|
std::string text,
|
||||||
|
Reference in New Issue
Block a user