void op(int argc, char **argv) { double n2; char c; int i; sp=0; for (i = 0; i < argc; i++) { if ((c=argv[i][0])<'0'||c>'9') switch(c) { case '+': push_(pop_()+pop_()); break; case '*': push_(pop_()*pop_()); break; case '/': n2 = pop_(); push_(pop_()/n2); break; case '-': n2 = pop_(); push_(pop_()-n2); break; } else push_(atov(argv[i])); } printf("%f\n",pop_()); }
void SharedQueue::push_priority(element el) { down(space); down(mutex); push_(el, priority); up(mutex); up(size); }
void SharedQueue::push_medium(element el) { down(space); down(mutex); push_(el, medium); up(mutex); up(size); }
void SharedQueue::push(element el) { down(space); down(mutex); push_(el, standard); up(mutex); up(size); }
channel_op_status push( value_type const& va) { typename allocator_traits_t::pointer ptr{ allocator_traits_t::allocate( alloc_, 1) }; try { allocator_traits_t::construct( alloc_, ptr, va, alloc_); } catch (...) { allocator_traits_t::deallocate( alloc_, ptr, 1); throw; } std::unique_lock< mutex > lk( mtx_); return push_( { detail::convert( ptr) }, lk); }
void push(V v) { mpscq_node <V> * node = new mpscq_node<V>(); node->state = v; push_(node); { std::unique_lock<std::mutex> lock (mutex); cv.notify_all(); } }
Writer (XML::Element<C>& e) : attr__ (0) { push_ (e); }
void Element:: el_pre (Type const&) { push_ (::XSCRT::XML::Element< wchar_t > (L"el", top_ ())); }
void Element:: long_pre (Type const&) { push_ (::XSCRT::XML::Element< wchar_t > (L"long", top_ ())); }
void Element:: value_pre (Type const&) { push_ (::XSCRT::XML::Element< wchar_t > (L"value", top_ ())); }