コード例 #1
0
ファイル: thbuf.cpp プロジェクト: mokerjoke/HPCC-Platform
    ~CSmartRowBuffer()
    {
#ifdef _FULL_TRACE
        ActPrintLog(activity, "SmartBuffer destroy %x",(unsigned)(memsize_t)this);
#endif
        assertex(!waiting);
        assertex(!waitflush);
        // clear in/out contents 
        while (in->ordinality()) 
            ReleaseThorRow(in->dequeue());
        delete in;
        while (out->ordinality()) 
            ReleaseThorRow(out->dequeue());
        delete out;
    }
コード例 #2
0
ファイル: thmem.hpp プロジェクト: afishbeck/HPCC-Platform
 inline void setown(const void * _ptr)       
 { 
     TESTROW(_ptr);
     const void * temp = ptr; 
     ptr = _ptr; 
     if (temp)
         ReleaseThorRow(temp); 
 }
コード例 #3
0
ファイル: thmem.hpp プロジェクト: afishbeck/HPCC-Platform
 inline void set(const void * _ptr)          
 { 
     const void * temp = ptr;
     if (_ptr)
         LinkThorRow(_ptr);
     ptr = _ptr; 
     if (temp)
         ReleaseThorRow(temp); 
 }
コード例 #4
0
ファイル: thbuf.cpp プロジェクト: mokerjoke/HPCC-Platform
    void stop()
    {
#ifdef _FULL_TRACE
        ActPrintLog(activity, "SmartBuffer stop %x",(unsigned)(memsize_t)this);
#endif
        SpinBlock block(lock);
#ifdef _DEBUG
        if (waiting)
        {
            ActPrintLogEx(&activity->queryContainer(), thorlog_null, MCwarning, "CSmartRowBuffer::stop while nextRow waiting");
            PrintStackReport();
        }
#endif
        eoi = true;

        while (out&&out->ordinality()) 
            ReleaseThorRow(out->dequeue());
        while (NULL == in)
        {
            waiting = true;
            SpinUnblock unblock(lock);
            waitsem.wait();
        }
        while (out&&out->ordinality()) 
            ReleaseThorRow(out->dequeue());
        while (in&&in->ordinality()) 
            ReleaseThorRow(in->dequeue());
        diskin.kill();
        if (waiting) {
            waitsem.signal();
            waiting = false;
        }
        if (waitflush) {
            waitflushsem.signal();
            waitflush = false;
        }
    }
コード例 #5
0
ファイル: thbuf.cpp プロジェクト: mokerjoke/HPCC-Platform
 void putRow(const void *row)
 {
     REENTRANCY_CHECK(putrecheck)
     size32_t sz = thorRowMemoryFootprint(serializer, row);
     SpinBlock block(lock);
     if (eoi) {
         ReleaseThorRow(row);
         
         return;
     }       
     assertex(in);  // reentry check
     if (sz+insz+(in->ordinality()+2)*sizeof(byte)>blocksize) // byte extra per row + end byte
         diskflush();
     in->enqueue(row);
     insz += sz;
     if (waiting) {
         waitsem.signal();
         waiting = false;
     }
 }
コード例 #6
0
ファイル: thmem.hpp プロジェクト: afishbeck/HPCC-Platform
 inline ~OwnedConstThorRow()                             { ReleaseThorRow(ptr); }
コード例 #7
0
ファイル: thmem.hpp プロジェクト: afishbeck/HPCC-Platform
 inline void clear()                         { const void *temp=ptr; ptr=NULL; ReleaseThorRow(temp); }