diff options
| -rw-r--r-- | src/ctx.cpp | 17 | ||||
| -rw-r--r-- | src/proj_experimental.h | 6 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/ctx.cpp b/src/ctx.cpp index ab51d6c1..1742ee87 100644 --- a/src/ctx.cpp +++ b/src/ctx.cpp @@ -29,6 +29,7 @@ #include <stdlib.h> #include <string.h> +#include "proj_experimental.h" #include "proj_internal.h" #include "projects.h" @@ -64,6 +65,22 @@ void pj_set_ctx( projPJ pj, projCtx ctx ) } /************************************************************************/ +/* proj_assign_context() */ +/************************************************************************/ + +/** \brief Re-assign a context to a PJ* object. + * + * This may be useful if the PJ* has been created with a context that is + * thread-specific, and is later used in another thread. In that case, + * the user may want to assign another thread-specific context to the + * object. + */ +void proj_assign_context( PJ* pj, PJ_CONTEXT* ctx ) +{ + pj_set_ctx( pj, ctx ); +} + +/************************************************************************/ /* pj_get_default_ctx() */ /************************************************************************/ diff --git a/src/proj_experimental.h b/src/proj_experimental.h index 9c72dbfe..292a3baf 100644 --- a/src/proj_experimental.h +++ b/src/proj_experimental.h @@ -892,6 +892,12 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_equal_earth( /**@}*/ +/*! @cond Doxygen_Suppress */ + +void PROJ_DLL proj_assign_context( PJ* pj, PJ_CONTEXT* ctx ); + +/*! @endcond */ + #ifdef __cplusplus } #endif |
