Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

glcontextmanager.cpp 1.89 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "glcontextmanager.h"

#include "tgt/assert.h"

namespace tgt {

    GlContextManager* GlContextManager::singletonClass_ = 0;

    GlContextManager::GlContextManager()
        : _currentContext(0)
    {
    }

    GlContextManager::~GlContextManager()
    {
        for (std::map<std::string, GLCanvas*>::iterator it = _contexts.begin(); it != _contexts.end(); ++it) {
            delete it->second;
        }
        _contexts.clear();
    }


    GLCanvas* GlContextManager::getContextByKey(const std::string& key) {
        std::map<std::string, GLCanvas*>::iterator it = _contexts.find(key);
        if (it != _contexts.end())
            return it->second;
        else
            return 0;
    }

    void GlContextManager::lock() {
        _glMutex.lock();
    }

    void GlContextManager::unlock() {
        _glMutex.unlock();
    }

    tbb::mutex& GlContextManager::getGlMutex() {
        return _glMutex;
    }

    void GlContextManager::releaseCurrentContext() {
44
45
        if (_currentContext != 0)
	  glFinish();
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
        setCurrent(0);
    }

    GLCanvas* GlContextManager::getCurrentContext() const {
        return _currentContext;
    }

    GlContextManager* GlContextManager::getPtr() {
        tgtAssert( singletonClass_ != 0, "singletonClass_ has not been intitialized." );
        return singletonClass_;
    }

    GlContextManager& GlContextManager::getRef() {
        tgtAssert( singletonClass_ != 0 , "singletonClass_ has not been intitialized." );
        return *singletonClass_;
    }

    bool GlContextManager::isInited() {
        return (singletonClass_ != 0);
    }

    void GlContextManager::lockAndAcquire(GLCanvas* context) {
        lock();
        setCurrent(context);
    }

    void GlContextManager::releaseAndUnlock() {
        releaseCurrentContext();
        unlock();
    }

    void GlContextManager::acquireContext(GLCanvas* context) {
        setCurrent(context);
    }


}