Date: 2007-02-15 08:56 pm (UTC)
From: [identity profile] natulkin.livejournal.com
Очень тяжело смотреть было и цветы жалко, красиво, но много.

Date: 2007-02-15 09:08 pm (UTC)
From: [identity profile] febb.livejournal.com
Тяжело - не смотри! :)

Date: 2007-02-15 09:09 pm (UTC)
From: [identity profile] natulkin.livejournal.com
Бе бе бе :)))
у меня левое бедро болит! :)

Date: 2007-02-15 09:32 pm (UTC)
From: [identity profile] febb.livejournal.com
Об кого стукнула? :)

Date: 2007-02-15 09:39 pm (UTC)
From: [identity profile] natulkin.livejournal.com
Ой, это внутренние какие-то резервы иссякают! :(
А ты ставишь после круглой скобочки пробел, та, что после названия функции и перед перечислением параметров? :)

Date: 2007-02-15 09:41 pm (UTC)
From: [identity profile] febb.livejournal.com
// Protected Messages Queue template with stopable waiting locks.
// M - message class,
// C - STL messages container (deque by default)
// MaxSize is required for effective resources control by Semaphores
template
[Error: Irreparable invalid markup ('<class [...] m,>') in entry. Owner must fix manually. Raw contents below.]

// Protected Messages Queue template with stopable waiting locks.
// M - message class,
// C - STL messages container (deque<M> by default)
// MaxSize is required for effective resources control by Semaphores
template <class M, class C = std::deque< M > >
class QueueT : private _BaseClassNotReplicatable
{
protected:
// max size of buffer
size_t m_SizeMax; // Max Size of buffer
Semaphore m_sNotEmpty, m_sNotFull;
CriticalSection m_csBuf;
C m_Buf;
Lock m_LockGet, m_LockPut; // Lockers: used Semaphores: m_sNotEmpty, m_sNotFull;
public:
//CTOR: creates buffer queue of max size.
QueueT(size_t size_max = 1) : m_SizeMax(size_max), m_sNotEmpty(0), m_sNotFull(size_max),
m_LockGet(m_sNotEmpty), m_LockPut(m_sNotFull) { }

//Threadsafe Get data from queue with timeout
bool Get(M & m, ulong timeout = INFINITE_TIMEOUT) {
if(!m_LockGet.Wait(timeout)) return false;
m_csBuf.enter(); // protect buffer
m = m_Buf.front(); m_Buf.pop_front();
m_csBuf.leave();
m_LockPut.Release();
return true;
}
//Threadsafe Put data in queue with timeout
bool Put(const M & m, ulong timeout = INFINITE_TIMEOUT) {
if(!m_LockPut.Wait(timeout)) return false;
m_csBuf.enter(); // protect buffer
m_Buf.push_back(m);
m_csBuf.leave();
m_LockGet.Release();
return true;
}
void StopPut(void) { m_LockPut.Stop(); }
void StopGet(void) { m_LockGet.Stop(); }
// Threadsafe signal Abort flag, releasing all waiting threads...
// Important: INFINITE_TIMEOUT can be used without deadlocks with this function:
void Stop(void) { StopPut(); StopGet(); }
}; // QueueT template

Date: 2007-02-15 09:45 pm (UTC)
From: [identity profile] natulkin.livejournal.com
Не ставишь...
А почему скобка фигурная на той же строке в начале функции, это я не люблю...

Date: 2007-02-15 09:47 pm (UTC)
From: [identity profile] natulkin.livejournal.com
Ладно, это инлайн функция, прощаю...
Все равно, ты мне нравишься :))

Date: 2007-02-15 09:48 pm (UTC)
From: [identity profile] febb.livejournal.com
Я многим нравлюсь! :)))

Date: 2007-02-15 09:51 pm (UTC)
From: [identity profile] natulkin.livejournal.com
Так и я многим. Удивил! Хо!
Зато я под Симбиан умею программировать, хотя, конечно, симафоры и критикалсекшн - это по высокому классу... Уважительно, ага...

Date: 2007-02-15 09:56 pm (UTC)
From: [identity profile] febb.livejournal.com
Девушки от тебя без ума!? :)

Date: 2007-02-15 09:58 pm (UTC)
From: [identity profile] natulkin.livejournal.com
Я сама от себя без ума :)))

Date: 2007-02-15 09:59 pm (UTC)
From: [identity profile] febb.livejournal.com

Это самое главноe! ;)

Date: 2007-02-15 10:00 pm (UTC)
From: [identity profile] natulkin.livejournal.com
Точно :)

Profile

febb: (Default)
febb

March 2022

S M T W T F S
  1 2 345
6 7 89 101112
13141516171819
20212223242526
2728293031  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 10th, 2026 10:40 pm
Powered by Dreamwidth Studios