///////////////////////////////////////////////////////
| 682 | |
| 683 | //////////////////////////////////////////////////////////// |
| 684 | GlFunctionPointer GlContext::getFunction(const char* name) |
| 685 | { |
| 686 | // Make sure we don't try to create the shared context here since |
| 687 | // setActive can be called during construction and lead to infinite recursion |
| 688 | auto* sharedContext = SharedContext::getWeakPtr().lock().get(); |
| 689 | |
| 690 | // We can't and don't need to lock when we are currently creating the shared context |
| 691 | std::unique_lock<std::recursive_mutex> lock; |
| 692 | |
| 693 | if (sharedContext) |
| 694 | lock = std::unique_lock(sharedContext->mutex); |
| 695 | |
| 696 | return ContextType::getFunction(name); |
| 697 | } |
| 698 | |
| 699 | |
| 700 | //////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected