Exemplo n.º 1
0
Arquivo: dur.cpp Projeto: rakex/mongo
 static void go(BufBuilder& bb) {
     {
         readlocktry lk("", 1000);
         if( lk.got() ) {
             _go(bb);
             return;
         }
     }
     // starvation on read locks could occur.  so if read lock acquisition is slow, try to get a 
     // write lock instead.  otherwise writes could use too much RAM.
     writelock lk;
     _go(bb);
 }
Exemplo n.º 2
0
        static void go() {
            if( !commitJob.hasWritten() )
                return;

            {
                readlocktry lk("", 1000);
                if( lk.got() ) {
                    _go();
                    return;
                }
            }

            // starvation on read locks could occur.  so if read lock acquisition is slow, try to get a 
            // write lock instead.  otherwise writes could use too much RAM.
            writelock lk;
            _go();
        }
Exemplo n.º 3
0
 /** called when a MongoMMF is closing -- we need to go ahead and group commit in that case before its 
     views disappear 
 */
 void closingFileNotification() {
     if( dbMutex.atLeastReadLocked() ) {
         _go(); 
     }
     else {
         assert( inShutdown() );
         if( commitJob.hasWritten() ) { 
             log() << "dur warning files are closing outside locks with writes pending" << endl;
         }
     }
 }
Exemplo n.º 4
0
void CommandSet::go()
{
    /* holonomics and shit */
    float x_vel = atof(sCmd.next());
    float y_vel = atof(sCmd.next());
    float r_vel = atof(sCmd.next());

    Serial.println(F("A"));
    #ifdef FW_DEBUG
    Serial.println(F("Going"));
    #endif

    _go(x_vel, y_vel, r_vel);
}
Exemplo n.º 5
0
void CommandSet::shuntkick()
{
    if (state.grabber_state != Open || state.kicker_state == Kicking) {
        Serial.println(F("N - shuntkick"));
        return;
    }
    Serial.println(F("A"));
    #ifdef FW_DEBUG
    Serial.println(F("shuntkicking"));
    #endif

    const pid_t pid = state.shuntkick_handler->id;

    _go(0, 255, 0);

    processes.enable(pid);
    processes.forward(pid);
}
Exemplo n.º 6
0
static void
handle(int sig)
{
    _go(1);
    exit(0);
}
int _start(char* argstr, long arglen, struct ExecBase* sysbase) 
{
   SysBase = (Library*)sysbase;
   return _go();
}
Exemplo n.º 8
0
 int HttpClient::post( string url , string data , Result * result ) {
     return _go( "POST" , url , data.c_str() , result );
 }
Exemplo n.º 9
0
 int HttpClient::get( string url , Result * result ) {
     return _go( "GET" , url , 0 , result );
 }
Exemplo n.º 10
0
 int HttpClient::post( const std::string& url , const std::string& data , Result * result ) {
     return _go( "POST" , url , data.c_str() , result );
 }
Exemplo n.º 11
0
 int HttpClient::get( const std::string& url , Result * result ) {
     return _go( "GET" , url , 0 , result );
 }