_ = "abc".ToUpper().ToLower();
}
+ public static void CoreclrPreload()
+ {
+ CheckAsciiCasing();
+ }
+
public static void Preload()
{
CheckAsciiCasing();
if (!Directory.Exists(preloadPath))
return;
+ string uifw = System.Environment.GetEnvironmentVariable("TIZEN_UIFW");
string[] paths = Directory.GetFiles(preloadPath, "*.preload");
Array.Sort(paths);
foreach (string path in paths)
if (fileName.IndexOf('.') != 2)
continue;
- string value = System.Environment.GetEnvironmentVariable("TIZEN_UIFW");
// if TIZEN_UIFW is not set, do not preload UI related dll
- if (value == null && (fileName.Contains("NUI") || fileName.Contains("ElmSharp") || fileName.Contains("XSF") ))
+ if (uifw == null && (fileName.Contains("NUI") || fileName.Contains("ElmSharp") || fileName.Contains("XSF")))
continue;
- else if (value == "ElmSharp" && fileName.Contains("NUI"))
+ else if (uifw == "ElmSharp" && (fileName.Contains("NUI") || fileName.Contains("XSF")))
continue;
- else if (value == "NUI" && (fileName.Contains("ElmSharp") || fileName.Contains("XSF")))
+ else if (uifw == "NUI" && (fileName.Contains("ElmSharp") || fileName.Contains("XSF")))
continue;
try
{
- Console.WriteLine("Start preload : " + fileName);
+ Console.WriteLine("UIFW: " + uifw + " Start preload : " + fileName);
BindingFlags bindingFlag = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
foreach (string line in File.ReadLines(path))
{
EXTRA_ARG --profile
EXTRA_ARG --appType
EXTRA_ARG dotnet-nui
+EXTRA_ARG TIZEN_UIFW
+EXTRA_ARG NUI
EXTRA_ARG --standalone
EXTRA_ARG --profile
EXTRA_ARG --appType
EXTRA_ARG dotnet
+EXTRA_ARG TIZEN_UIFW
+EXTRA_ARG ElmSharp
EXTRA_ARG --standalone
#define APPID_MAX_LENGTH (25 + 105)
#define PRC_NAME_LENGTH 16
+static const char* KEY_TIZEN_UIFW = "TIZEN_UIFW";
static std::string StandaloneOption("--standalone");
static std::string PaddingOption("--PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE");
static std::string AppTypeOption("--appType");
+static std::string UIFWOption(KEY_TIZEN_UIFW);
static std::string ProfileOption("--profile");
static std::string GlobalizationInvariantOption("--invariant");
bool paddingExist = false;
bool profile = false;
const char* appType = "dotnet";
+ const char* UIFWType = "ElmSharp";
const char* appRootPath = NULL;
char appId[APPID_MAX_LENGTH] = {0,};
setenv("DOTNET_SYSTEM_GLOBALIZATION_PREDEFINED_CULTURES_ONLY", "false", 1);
} else if (StandaloneOption.compare(argv[i]) == 0) {
if (i > argc - 1) {
- _ERR("Assembly path must be after \"--standalone\" option");
+ _ERR("Assembly path must be after %s option", StandaloneOption.c_str());
return -1;
}
i++;
profile = true;
} else if (AppTypeOption.compare(argv[i]) == 0) {
if (i > argc - 1) {
- _ERR("app type for launchpad must be after \"--appType\" option");
+ _ERR("app type for launchpad must be after %s option", AppTypeOption.c_str());
return -1;
}
i++;
appType = argv[i];
+ } else if (UIFWOption.compare(argv[i]) == 0) {
+ if (i > argc - 1) {
+ _ERR("UIFW type for launchpad must be after %s option", UIFWOption.c_str());
+ return -1;
+ }
+ i++;
+ UIFWType = argv[i];
} else {
vargs.push_back(argv[i]);
}
memset(argv[0], '\0', cmdlineSize);
snprintf(argv[0], cmdlineSize - 1, "%s", standalonePath);
+ setenv(KEY_TIZEN_UIFW, UIFWType, 1);
+ _INFO("TIZEN_UIFW is set to %s", UIFWType);
+
// initialize CoreRuntime
int err = CoreRuntime::initialize(appType, LaunchMode::launcher);
if (err) {
pluginPreload();
}
-static pthread_t preloadThreadId = 0;
-static void* preloadThread(void* arg)
+static pthread_t coreclrPreloadThreadId = 0;
+static void* coreclrPreloadThread(void* arg)
{
- _INFO("PreloadThread START\n");
- preload();
- _INFO("PreloadThread END\n");
+ _INFO("CoreclrPreloadThread START\n");
+ typedef void (*CoreclrPreloadDelegate)();
+ CoreclrPreloadDelegate coreclrPreloadDelegate;
+
+ int ret = createDelegate(__hostHandle,
+ __domainId,
+ "Tizen.Runtime",
+ "Tizen.Runtime.Preloader",
+ "CoreclrPreload",
+ (void**)&coreclrPreloadDelegate);
+
+ if (ret < 0) {
+ _ERR("Failed to create delegate for Tizen.Runtime CoreclrPreload (0x%08x)", ret);
+ } else {
+ coreclrPreloadDelegate();
+ }
+ _INFO("CoreclrPreloadThread END\n");
pthread_exit(NULL);
}
return -1;
}
- // preload libraries and manage dlls for optimizing startup time
- int err = pthread_create(&preloadThreadId, NULL, preloadThread, NULL);
+ //Preload and execute long-duration jobs
+ int err = pthread_create(&coreclrPreloadThreadId, NULL, coreclrPreloadThread, NULL);
if (err) {
- _ERR("PreloadThread Creation Failed: %s", strerror(err));
+ _ERR("CoreclrPreloadThread Creation Failed: %s", strerror(err));
}
if (launchMode == LaunchMode::loader) {
+ // preload libraries and manage dlls for optimizing startup time
+ preload();
+
// The debug pipe created in the candidate process has a "User" label.
// As a result, smack deny occurs when app process try to access the debug pipe.
// Also, since debugging is performed only in standalone mode,